summaryrefslogtreecommitdiff
path: root/src/su.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/su.c')
-rw-r--r--src/su.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/su.c b/src/su.c
index d719011..d604faa 100644
--- a/src/su.c
+++ b/src/su.c
@@ -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 */