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

  1. --- a/src/su.c
  2. +++ b/src/su.c
  3. @@ -1122,8 +1122,12 @@ int main (int argc, char **argv)
  4. if (fd >= 0) {
  5. err = ioctl (fd, TIOCNOTTY, (char *) 0);
  6. + if (-1 == err && ENOTTY == errno) {
  7. + /* There are no controlling terminal already */
  8. + err = 0;
  9. + }
  10. (void) close (fd);
  11. - } else if (ENXIO == errno) {
  12. + } else if (ENXIO == errno || EACCES == errno) {
  13. /* There are no controlling terminal already */
  14. err = 0;
  15. }