diff options
Diffstat (limited to 'src/su.c')
-rw-r--r-- | src/su.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -2,7 +2,7 @@ * Copyright (c) 1989 - 1994, Julianne Frances Haugh * Copyright (c) 1996 - 2000, Marek Michałkiewicz * Copyright (c) 2000 - 2006, Tomasz Kłoczko - * Copyright (c) 2007 - 2011, Nicolas François + * Copyright (c) 2007 - 2012, Nicolas François * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -53,7 +53,7 @@ #include <config.h> -#ident "$Id: su.c 3560 2011-11-06 18:39:59Z nekral-guest $" +#ident "$Id: su.c 3743 2012-05-25 11:51:53Z nekral-guest $" #include <getopt.h> #include <grp.h> @@ -1092,6 +1092,9 @@ int main (int argc, char **argv) if (fd >= 0) { err = ioctl (fd, TIOCNOTTY, (char *) 0); (void) close (fd); + } else if (ENXIO == errno) { + /* There are no controlling terminal already */ + err = 0; } #endif /* USE_PAM */ |