diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2002-08-05 17:04:37 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2002-08-05 17:04:37 +0000 |
commit | 1cdad281aab6eab5b89575af95204d051ed7588e (patch) | |
tree | d542fae25a69244b358d88a5ee5b7ef85a8b76d5 /usr.bin | |
parent | d5890cc08796393adcb266308657cd9c6112e17d (diff) |
dup2() style nit--don't dup2() if oldfd == newfd; espie@ OK.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/make/cmd_exec.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/make/cmd_exec.c b/usr.bin/make/cmd_exec.c index 9775cc5f696..2a65e0c384d 100644 --- a/usr.bin/make/cmd_exec.c +++ b/usr.bin/make/cmd_exec.c @@ -1,5 +1,5 @@ /* $OpenPackages$ */ -/* $OpenBSD: cmd_exec.c,v 1.2 2002/07/31 19:29:20 mickey Exp $ */ +/* $OpenBSD: cmd_exec.c,v 1.3 2002/08/05 17:04:36 millert Exp $ */ /* * Copyright (c) 2001 Marc Espie. * @@ -79,9 +79,10 @@ Cmd_Exec(cmd, err) * stream: user can use redirection to grab it as this goes * through /bin/sh. */ - (void)dup2(fds[1], 1); - if (fds[1] != 1) + if (fds[1] != 1) { + (void)dup2(fds[1], 1); (void)close(fds[1]); + } (void)execv(_PATH_BSHELL, args); _exit(1); |