]> granicus.if.org Git - ngircd/commitdiff
PAM-Auth child: log if result can't be reported
authorAlexander Barton <alex@barton.de>
Wed, 23 Feb 2011 21:55:45 +0000 (22:55 +0100)
committerAlexander Barton <alex@barton.de>
Wed, 23 Feb 2011 21:55:45 +0000 (22:55 +0100)
This fixes the followin GCC warning on modern Linux systems as well:

irc-login.c:     In function ‘Hello_User’:
irc-login.c:876: warning: ignoring return value of ‘write’,
                 declared with attribute warn_unused_result

src/ngircd/irc-login.c

index 6a97074aa94491b067ca2369845ec5f36fefdd9c..f76a62707ae8c22cc097385da60ecda80a16db74 100644 (file)
@@ -873,7 +873,9 @@ Hello_User(CLIENT * Client)
                /* Sub process */
                Log_Init_Subprocess("Auth");
                result = PAM_Authenticate(Client);
-               write(pipefd[1], &result, sizeof(result));
+               if (write(pipefd[1], &result, sizeof(result)) != sizeof(result))
+                       Log_Subprocess(LOG_ERR,
+                                      "Failed to pipe result to parent!");
                Log_Exit_Subprocess("Auth");
                exit(0);
        }