You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

16 lines
407 B

--- a/src/su.c
+++ b/src/su.c
@@ -1090,8 +1090,12 @@
if (fd >= 0) {
err = ioctl (fd, TIOCNOTTY, (char *) 0);
+ if (-1 == err && ENOTTY == errno) {
+ /* There are no controlling terminal already */
+ err = 0;
+ }
(void) close (fd);
- } else if (ENXIO == errno) {
+ } else if (ENXIO == errno || EACCES == errno) {
/* There are no controlling terminal already */
err = 0;
}