projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8804c6a
)
patch by Shaun Jackman to combine dup/close funcs into dup2
author
Mike Frysinger
<vapier@gentoo.org>
Thu, 30 Jun 2005 03:43:14 +0000
(
03:43
-0000)
committer
Mike Frysinger
<vapier@gentoo.org>
Thu, 30 Jun 2005 03:43:14 +0000
(
03:43
-0000)
coreutils/watch.c
patch
|
blob
|
history
diff --git
a/coreutils/watch.c
b/coreutils/watch.c
index 8a6a019bcde24bdd49d0399829a76db335401a85..31fadfb852e33a207838a96735f1e9996ea6e8f9 100644
(file)
--- a/
coreutils/watch.c
+++ b/
coreutils/watch.c
@@
-82,7
+82,7
@@
extern int watch_main(int argc, char **argv)
header[len] = 0;
/* thanks to lye, who showed me how to redirect stdin/stdout */
- old_stdout = dup(
1
);
+ old_stdout = dup(
STDOUT_FILENO
);
while (1) {
time(&t);
@@
-98,8
+98,7
@@
extern int watch_main(int argc, char **argv)
sleep(period);
} else if (0 == pid) {
//child
- close(1);
- dup(old_stdout);
+ dup2(old_stdout, STDOUT_FILENO);
execvp(*watched_argv, watched_argv);
bb_perror_msg_and_die(*watched_argv);
} else {