summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2008-09-12 05:33:00 +0000
committerkientzle <kientzle@FreeBSD.org>2008-09-12 05:33:00 +0000
commitf86ac1c5747117abc2763a3cdf377374346c51ec (patch)
treeb53e90f7595c2cad3e0bd878df57b911baf5722c /lib
parentccdf5b420c98da86504569985859e9c0c043f4bf (diff)
downloadFreeBSD-src-f86ac1c5747117abc2763a3cdf377374346c51ec.zip
FreeBSD-src-f86ac1c5747117abc2763a3cdf377374346c51ec.tar.gz
Portability: Don't use symbolic constants when the values are more
standard than the names are. Remove some trailing whitespace.
Diffstat (limited to 'lib')
-rw-r--r--lib/libarchive/filter_fork.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/libarchive/filter_fork.c b/lib/libarchive/filter_fork.c
index caf8c31..a4d1a98 100644
--- a/lib/libarchive/filter_fork.c
+++ b/lib/libarchive/filter_fork.c
@@ -61,7 +61,7 @@ __archive_create_child(const char *path, int *child_stdin, int *child_stdout)
if (pipe(stdin_pipe) == -1)
goto state_allocated;
- if (stdin_pipe[0] == STDOUT_FILENO) {
+ if (stdin_pipe[0] == 1 /* stdout */) {
if ((tmp = dup(stdin_pipe[0])) == -1)
goto stdin_opened;
close(stdin_pipe[0]);
@@ -69,7 +69,7 @@ __archive_create_child(const char *path, int *child_stdin, int *child_stdout)
}
if (pipe(stdout_pipe) == -1)
goto stdin_opened;
- if (stdout_pipe[1] == STDIN_FILENO) {
+ if (stdout_pipe[1] == 0 /* stdin */) {
if ((tmp = dup(stdout_pipe[1])) == -1)
goto stdout_opened;
close(stdout_pipe[1]);
@@ -86,16 +86,16 @@ __archive_create_child(const char *path, int *child_stdin, int *child_stdout)
case 0:
close(stdin_pipe[1]);
close(stdout_pipe[0]);
- if (dup2(stdin_pipe[0], STDIN_FILENO) == -1)
+ if (dup2(stdin_pipe[0], 0 /* stdin */) == -1)
_exit(254);
- if (stdin_pipe[0] != STDIN_FILENO)
+ if (stdin_pipe[0] != 0 /* stdin */)
close(stdin_pipe[0]);
- if (dup2(stdout_pipe[1], STDOUT_FILENO) == -1)
+ if (dup2(stdout_pipe[1], 1 /* stdout */) == -1)
_exit(254);
- if (stdout_pipe[1] != STDOUT_FILENO)
+ if (stdout_pipe[1] != 1 /* stdout */)
close(stdout_pipe[1]);
execlp(path, path, (char *)NULL);
- _exit(254);
+ _exit(254);
default:
close(stdin_pipe[0]);
close(stdout_pipe[1]);
OpenPOWER on IntegriCloud