summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2002-06-21 21:10:32 +0000
committermillert <millert@openbsd.org>2002-06-21 21:10:32 +0000
commita0f600ecd5a9477723e272a85dcea352128b442d (patch)
treec9b4e3a93baa56a50d0a44e3ff7cac000c242fa4
parentBump version to help distinquish new memory probe and fixes. (diff)
downloadwireguard-openbsd-a0f600ecd5a9477723e272a85dcea352128b442d.tar.xz
wireguard-openbsd-a0f600ecd5a9477723e272a85dcea352128b442d.zip
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.
-rw-r--r--usr.sbin/cron/do_command.c6
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);