Fix check for dup2() return value.
This commit is contained in:
@@ -490,7 +490,7 @@ send_mail(const char *fmt, ...)
|
|||||||
|
|
||||||
/* Child, set stdin to output side of the pipe */
|
/* Child, set stdin to output side of the pipe */
|
||||||
if (pfd[0] != STDIN_FILENO) {
|
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");
|
mysyslog(LOG_ERR, "cannot dup stdin: %m");
|
||||||
_exit(127);
|
_exit(127);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user