]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
Ignore close() failure before exiting.
authorNicolas François <nicolas.francois@centraliens.net>
Mon, 19 Aug 2013 22:11:08 +0000 (00:11 +0200)
committerNicolas François <nicolas.francois@centraliens.net>
Mon, 19 Aug 2013 22:11:08 +0000 (00:11 +0200)
* src/su.c: Ignore close() failure before exiting.

ChangeLog
src/su.c

index 390454b7296004421ede2915abde1c6615765af8..926b745b2f1e192bacf962e7ec02928cd2e81f53 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-08-19  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * src/su.c: Ignore close() failure before exiting.
+
 2013-08-19  Nicolas François  <nicolas.francois@centraliens.net>
 
        * src/su.c: Remove duplicate include of sys/types.h
index 8de1766fd1f0a4e0f1a68cfad510163d986a2cb3..aa0d696c2366ce8ec15e11b390ccace9de7f6856 100644 (file)
--- a/src/su.c
+++ b/src/su.c
@@ -313,24 +313,24 @@ static void handle_session (void)
 
                if (grantpt (fd_ptmx) == -1) {
                        fprintf (stderr, _("%s: Cannot grant pt master permissions\n"), Prog);
-                       close (fd_ptmx);
+                       (void) close (fd_ptmx);
                        exit (1);
                }
                if (unlockpt (fd_ptmx) == -1) {
                        fprintf (stderr, _("%s: Cannot unlock pt master\n"), Prog);
-                       close (fd_ptmx);
+                       (void) close (fd_ptmx);
                        exit (1);
                }
 
                if ((pts_name = ptsname (fd_ptmx)) == NULL) {
                        fprintf (stderr, _("%s: Cannot get pt slave name\n"), Prog);
-                       close (fd_ptmx);
+                       (void) close (fd_ptmx);
                        exit (1);
                }
 
                if ((fd_pts = open (pts_name, O_RDWR )) == -1) {
                        fprintf (stderr, _("%s: Cannot open pt slave\n"), Prog);
-                       close (fd_ptmx);
+                       (void) close (fd_ptmx);
                        exit (1);
                }
        }
@@ -345,7 +345,7 @@ static void handle_session (void)
                        
                        if (tcsetattr (fd_pts, TCSANOW, &termset_save) == -1) {
                                fprintf (stderr, _("%s: Cannot set set termios attributes of sessiont\n"), Prog);
-                               close (fd_pts);
+                               (void) close (fd_pts);
                                exit (1);
                        }
 
@@ -524,7 +524,7 @@ static void handle_session (void)
                } while (!stop);
 
                if (have_tty == true) {
-                       close (fd_pts);
+                       (void) close (fd_pts);
                        /* Reset RAW mode  */
                        if (tcsetattr (STDIN_FILENO, TCSANOW, &termset_save) == -1) {
                                fprintf (stderr,