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
440 B

--- a/src/su.c
+++ b/src/su.c
@@ -1122,8 +1122,12 @@ int main (int argc, char **argv)
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;
}