diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2002-06-21 21:10:33 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2002-06-21 21:10:33 +0000 |
commit | 8b7e0454a5cd102eb36c0c5786ab92612170b8b0 (patch) | |
tree | af18d769c5cbc9d030f8fa3382ba6b34bf675109 /usr.sbin | |
parent | 3a52bc587d857776ff0c095ec808af37fa13c9ab (diff) |
Correctly close the writing end of the pipe when dup'ing the fd to
stdout. This was a pasto/thinko on my part. Problem found by
jean-philippe wan-hoi.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/cron/do_command.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/cron/do_command.c b/usr.sbin/cron/do_command.c index 22914ff16bd..abe7f6e8234 100644 --- a/usr.sbin/cron/do_command.c +++ b/usr.sbin/cron/do_command.c @@ -1,4 +1,4 @@ -/* $OpenBSD: do_command.c,v 1.14 2002/06/14 21:35:01 todd Exp $ */ +/* $OpenBSD: do_command.c,v 1.15 2002/06/21 21:10:32 millert Exp $ */ /* Copyright 1988,1990,1993,1994 by Paul Vixie * All rights reserved */ @@ -21,7 +21,7 @@ */ #if !defined(lint) && !defined(LINT) -static char rcsid[] = "$OpenBSD: do_command.c,v 1.14 2002/06/14 21:35:01 todd Exp $"; +static char rcsid[] = "$OpenBSD: do_command.c,v 1.15 2002/06/21 21:10:32 millert Exp $"; #endif #include "cron.h" @@ -187,8 +187,8 @@ child_process(entry *e, user *u) { close(stdin_pipe[READ_PIPE]); } if (stdout_pipe[WRITE_PIPE] != STDOUT) { - close(STDOUT); dup2(stdout_pipe[WRITE_PIPE], STDOUT); + close(stdout_pipe[WRITE_PIPE]); } dup2(STDOUT, STDERR); |