]> granicus.if.org Git - sudo/commitdiff
Fix check for dup2() return value.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 19 Jul 2010 16:37:39 +0000 (12:37 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 19 Jul 2010 16:37:39 +0000 (12:37 -0400)
--HG--
branch : 1.7

logging.c

index 3f1d855643e58875a35a431e169a9a811c3955fd..2b329683f187c73c59073c17efa4be9673d51ad1 100644 (file)
--- a/logging.c
+++ b/logging.c
@@ -517,7 +517,7 @@ send_mail(fmt, va_alist)
 
                /* Child, set stdin to output side of the pipe */
                if (pfd[0] != STDIN_FILENO) {
-                   if (dup2(pfd[0], STDIN_FILENO) != -1) {
+                   if (dup2(pfd[0], STDIN_FILENO) == -1) {
                        mysyslog(LOG_ERR, "cannot dup stdin: %m");
                        _exit(127);
                    }