diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-02-16 13:18:17 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-02-16 13:18:17 +0000 |
commit | 284d0faed6a1ec2adcc4b7aea31ae3d05b3b70d9 (patch) | |
tree | 3cfcea06c5a5c9e454edd39b58111ef38810882c /archival | |
parent | 069e347863fa46f684ab6bd7e48cefd8fa74b629 (diff) | |
download | busybox-w32-284d0faed6a1ec2adcc4b7aea31ae3d05b3b70d9.tar.gz busybox-w32-284d0faed6a1ec2adcc4b7aea31ae3d05b3b70d9.tar.bz2 busybox-w32-284d0faed6a1ec2adcc4b7aea31ae3d05b3b70d9.zip |
random s/short/int/
add_cmd 1189 1190 +1
xconnect_ftpdata 118 117 -1
data_align 86 84 -2
process_files 2101 2096 -5
forkexec 1345 1334 -11
Diffstat (limited to 'archival')
-rw-r--r-- | archival/libunarchive/data_align.c | 6 | ||||
-rw-r--r-- | archival/tar.c | 9 |
2 files changed, 8 insertions, 7 deletions
diff --git a/archival/libunarchive/data_align.c b/archival/libunarchive/data_align.c index 9803199e0..d98dc5764 100644 --- a/archival/libunarchive/data_align.c +++ b/archival/libunarchive/data_align.c | |||
@@ -3,14 +3,12 @@ | |||
3 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. | 3 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. |
4 | */ | 4 | */ |
5 | 5 | ||
6 | //#include <sys/types.h> | ||
7 | |||
8 | #include "libbb.h" | 6 | #include "libbb.h" |
9 | #include "unarchive.h" | 7 | #include "unarchive.h" |
10 | 8 | ||
11 | void data_align(archive_handle_t *archive_handle, const unsigned short boundary) | 9 | void data_align(archive_handle_t *archive_handle, unsigned boundary) |
12 | { | 10 | { |
13 | const unsigned short skip_amount = (boundary - (archive_handle->offset % boundary)) % boundary; | 11 | unsigned skip_amount = (boundary - (archive_handle->offset % boundary)) % boundary; |
14 | 12 | ||
15 | archive_handle->seek(archive_handle, skip_amount); | 13 | archive_handle->seek(archive_handle, skip_amount); |
16 | archive_handle->offset += skip_amount; | 14 | archive_handle->offset += skip_amount; |
diff --git a/archival/tar.c b/archival/tar.c index 6b3738365..a8ff7b894 100644 --- a/archival/tar.c +++ b/archival/tar.c | |||
@@ -546,13 +546,16 @@ static int writeTarFile(const int tar_fd, const int verboseFlag, | |||
546 | 546 | ||
547 | if (gzipPid == 0) { | 547 | if (gzipPid == 0) { |
548 | /* child */ | 548 | /* child */ |
549 | xmove_fd(tbInfo.tarFd, 1); | 549 | /* NB: close _first_, then move fds! */ |
550 | xmove_fd(gzipDataPipe.rd, 0); | ||
551 | close(gzipDataPipe.wr); | 550 | close(gzipDataPipe.wr); |
552 | #if WAIT_FOR_CHILD | 551 | #if WAIT_FOR_CHILD |
553 | close(gzipStatusPipe.rd); | 552 | close(gzipStatusPipe.rd); |
553 | /* gzipStatusPipe.wr will close only on exec - | ||
554 | * parent waits for this close to happen */ | ||
554 | fcntl(gzipStatusPipe.wr, F_SETFD, FD_CLOEXEC); | 555 | fcntl(gzipStatusPipe.wr, F_SETFD, FD_CLOEXEC); |
555 | #endif | 556 | #endif |
557 | xmove_fd(gzipDataPipe.rd, 0); | ||
558 | xmove_fd(tbInfo.tarFd, 1); | ||
556 | /* exec gzip/bzip2 program/applet */ | 559 | /* exec gzip/bzip2 program/applet */ |
557 | BB_EXECLP(zip_exec, zip_exec, "-f", NULL); | 560 | BB_EXECLP(zip_exec, zip_exec, "-f", NULL); |
558 | vfork_exec_errno = errno; | 561 | vfork_exec_errno = errno; |
@@ -570,7 +573,7 @@ static int writeTarFile(const int tar_fd, const int verboseFlag, | |||
570 | 573 | ||
571 | /* Wait until child execs (or fails to) */ | 574 | /* Wait until child execs (or fails to) */ |
572 | n = full_read(gzipStatusPipe.rd, &buf, 1); | 575 | n = full_read(gzipStatusPipe.rd, &buf, 1); |
573 | if ((n < 0) && (/*errno == EAGAIN ||*/ errno == EINTR)) | 576 | if (n < 0 /* && errno == EAGAIN */) |
574 | continue; /* try it again */ | 577 | continue; /* try it again */ |
575 | 578 | ||
576 | } | 579 | } |