diff options
Diffstat (limited to 'archival')
-rw-r--r-- | archival/libunarchive/open_transformer.c | 16 | ||||
-rw-r--r-- | archival/libunarchive/seek_by_jump.c | 2 | ||||
-rw-r--r-- | archival/libunarchive/seek_by_read.c | 4 | ||||
-rw-r--r-- | archival/tar.c | 8 |
4 files changed, 15 insertions, 15 deletions
diff --git a/archival/libunarchive/open_transformer.c b/archival/libunarchive/open_transformer.c index d6f5e6271..3c551de06 100644 --- a/archival/libunarchive/open_transformer.c +++ b/archival/libunarchive/open_transformer.c | |||
@@ -15,10 +15,10 @@ int open_transformer(int src_fd, | |||
15 | USE_DESKTOP(long long) int (*transformer)(int src_fd, int dst_fd), | 15 | USE_DESKTOP(long long) int (*transformer)(int src_fd, int dst_fd), |
16 | const char *transform_prog) | 16 | const char *transform_prog) |
17 | { | 17 | { |
18 | int fd_pipe[2]; | 18 | struct fd_pair fd_pipe; |
19 | int pid; | 19 | int pid; |
20 | 20 | ||
21 | xpipe(fd_pipe); | 21 | xpiped_pair(fd_pipe); |
22 | 22 | ||
23 | #if BB_MMU | 23 | #if BB_MMU |
24 | pid = fork(); | 24 | pid = fork(); |
@@ -30,12 +30,12 @@ int open_transformer(int src_fd, | |||
30 | 30 | ||
31 | if (pid == 0) { | 31 | if (pid == 0) { |
32 | /* child process */ | 32 | /* child process */ |
33 | close(fd_pipe[0]); /* We don't want to read from the parent */ | 33 | close(fd_pipe.rd); /* We don't want to read from the parent */ |
34 | // FIXME: error check? | 34 | // FIXME: error check? |
35 | #if BB_MMU | 35 | #if BB_MMU |
36 | transformer(src_fd, fd_pipe[1]); | 36 | transformer(src_fd, fd_pipe.wr); |
37 | if (ENABLE_FEATURE_CLEAN_UP) { | 37 | if (ENABLE_FEATURE_CLEAN_UP) { |
38 | close(fd_pipe[1]); /* Send EOF */ | 38 | close(fd_pipe.wr); /* Send EOF */ |
39 | close(src_fd); | 39 | close(src_fd); |
40 | } | 40 | } |
41 | exit(0); | 41 | exit(0); |
@@ -43,7 +43,7 @@ int open_transformer(int src_fd, | |||
43 | { | 43 | { |
44 | char *argv[4]; | 44 | char *argv[4]; |
45 | xmove_fd(src_fd, 0); | 45 | xmove_fd(src_fd, 0); |
46 | xmove_fd(fd_pipe[1], 1); | 46 | xmove_fd(fd_pipe.wr, 1); |
47 | argv[0] = (char*)transform_prog; | 47 | argv[0] = (char*)transform_prog; |
48 | argv[1] = (char*)"-cf"; | 48 | argv[1] = (char*)"-cf"; |
49 | argv[2] = (char*)"-"; | 49 | argv[2] = (char*)"-"; |
@@ -56,7 +56,7 @@ int open_transformer(int src_fd, | |||
56 | } | 56 | } |
57 | 57 | ||
58 | /* parent process */ | 58 | /* parent process */ |
59 | close(fd_pipe[1]); /* Don't want to write to the child */ | 59 | close(fd_pipe.wr); /* Don't want to write to the child */ |
60 | 60 | ||
61 | return fd_pipe[0]; | 61 | return fd_pipe.rd; |
62 | } | 62 | } |
diff --git a/archival/libunarchive/seek_by_jump.c b/archival/libunarchive/seek_by_jump.c index edbf46b21..8b5f3e887 100644 --- a/archival/libunarchive/seek_by_jump.c +++ b/archival/libunarchive/seek_by_jump.c | |||
@@ -6,7 +6,7 @@ | |||
6 | #include "libbb.h" | 6 | #include "libbb.h" |
7 | #include "unarchive.h" | 7 | #include "unarchive.h" |
8 | 8 | ||
9 | void seek_by_jump(const archive_handle_t *archive_handle, const unsigned int amount) | 9 | void seek_by_jump(const archive_handle_t *archive_handle, unsigned amount) |
10 | { | 10 | { |
11 | if (lseek(archive_handle->src_fd, (off_t) amount, SEEK_CUR) == (off_t) -1) { | 11 | if (lseek(archive_handle->src_fd, (off_t) amount, SEEK_CUR) == (off_t) -1) { |
12 | #if ENABLE_FEATURE_UNARCHIVE_TAPE | 12 | #if ENABLE_FEATURE_UNARCHIVE_TAPE |
diff --git a/archival/libunarchive/seek_by_read.c b/archival/libunarchive/seek_by_read.c index 452d82d10..1f2b80571 100644 --- a/archival/libunarchive/seek_by_read.c +++ b/archival/libunarchive/seek_by_read.c | |||
@@ -6,10 +6,10 @@ | |||
6 | #include "libbb.h" | 6 | #include "libbb.h" |
7 | #include "unarchive.h" | 7 | #include "unarchive.h" |
8 | 8 | ||
9 | /* If we are reading through a pipe(), or from stdin then we can't lseek, | 9 | /* If we are reading through a pipe, or from stdin then we can't lseek, |
10 | * we must read and discard the data to skip over it. | 10 | * we must read and discard the data to skip over it. |
11 | */ | 11 | */ |
12 | void seek_by_read(const archive_handle_t *archive_handle, const unsigned int jump_size) | 12 | void seek_by_read(const archive_handle_t *archive_handle, unsigned jump_size) |
13 | { | 13 | { |
14 | if (jump_size) | 14 | if (jump_size) |
15 | bb_copyfd_exact_size(archive_handle->src_fd, -1, jump_size); | 15 | bb_copyfd_exact_size(archive_handle->src_fd, -1, jump_size); |
diff --git a/archival/tar.c b/archival/tar.c index a8ff7b894..4ec454b88 100644 --- a/archival/tar.c +++ b/archival/tar.c | |||
@@ -521,14 +521,14 @@ static int writeTarFile(const int tar_fd, const int verboseFlag, | |||
521 | 521 | ||
522 | volatile int vfork_exec_errno = 0; | 522 | volatile int vfork_exec_errno = 0; |
523 | #if WAIT_FOR_CHILD | 523 | #if WAIT_FOR_CHILD |
524 | struct { int rd; int wr; } gzipStatusPipe; | 524 | struct fd_pair gzipStatusPipe; |
525 | #endif | 525 | #endif |
526 | struct { int rd; int wr; } gzipDataPipe; | 526 | struct fd_pair gzipDataPipe; |
527 | const char *zip_exec = (gzip == 1) ? "gzip" : "bzip2"; | 527 | const char *zip_exec = (gzip == 1) ? "gzip" : "bzip2"; |
528 | 528 | ||
529 | xpipe(&gzipDataPipe.rd); | 529 | xpiped_pair(gzipDataPipe); |
530 | #if WAIT_FOR_CHILD | 530 | #if WAIT_FOR_CHILD |
531 | xpipe(&gzipStatusPipe.rd); | 531 | xpiped_pair(gzipStatusPipe); |
532 | #endif | 532 | #endif |
533 | 533 | ||
534 | signal(SIGPIPE, SIG_IGN); /* we only want EPIPE on errors */ | 534 | signal(SIGPIPE, SIG_IGN); /* we only want EPIPE on errors */ |