diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2012-03-06 19:33:42 +0400 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2012-03-06 19:33:42 +0400 |
commit | faac1d3e6e87dc6882e69b62f1c71907d892c876 (patch) | |
tree | c9feb257a4d47e71a5555360b0978e22c9e37dbf /archival/rpm2cpio.c | |
parent | 02c3c3842004d88207b46450dbd19f80e6596c7e (diff) |
tar,rpm2cpio: check that child decompressor did not error out
function old new delta
check_errors_in_children - 57 +57
tar_main 833 848 +15
get_header_tar 1720 1733 +13
rpm2cpio_main 147 140 -7
handle_SIGCHLD 41 - -41
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 2/1 up/down: 85/-48) Total: 37 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'archival/rpm2cpio.c')
-rw-r--r-- | archival/rpm2cpio.c | 35 |
1 files changed, 7 insertions, 28 deletions
diff --git a/archival/rpm2cpio.c b/archival/rpm2cpio.c index 7256aae6b..f3dfa5159 100644 --- a/archival/rpm2cpio.c +++ b/archival/rpm2cpio.c @@ -42,26 +42,6 @@ static unsigned skip_header(void) return sizeof(header) + len; } -#if SEAMLESS_COMPRESSION -static void handle_SIGCHLD(int signo UNUSED_PARAM) -{ - int status; - - /* Wait for any child without blocking */ - for (;;) { - if (wait_any_nohang(&status) < 0) - /* wait failed?! I'm confused... */ - return; - if (WIFEXITED(status) && WEXITSTATUS(status) == 0) - /* this child exited with 0 */ - continue; - /* Cannot happen? - if (!WIFSIGNALED(status) && !WIFEXITED(status)) ???; */ - bb_got_signal = 1; - } -} -#endif - /* No getopt required */ int rpm2cpio_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int rpm2cpio_main(int argc UNUSED_PARAM, char **argv) @@ -86,10 +66,9 @@ int rpm2cpio_main(int argc UNUSED_PARAM, char **argv) /* Skip the main header */ skip_header(); -#if SEAMLESS_COMPRESSION - /* We need to know whether child (gzip/bzip/etc) exits abnormally */ - signal(SIGCHLD, handle_SIGCHLD); -#endif + //if (SEAMLESS_COMPRESSION) + // /* We need to know whether child (gzip/bzip/etc) exits abnormally */ + // signal(SIGCHLD, check_errors_in_children); /* This works, but doesn't report uncompress errors (they happen in child) */ setup_unzip_on_fd(rpm_fd, /*fail_if_not_detected:*/ 1); @@ -100,9 +79,9 @@ int rpm2cpio_main(int argc UNUSED_PARAM, char **argv) close(rpm_fd); } -#if SEAMLESS_COMPRESSION - return bb_got_signal; -#else + if (SEAMLESS_COMPRESSION) { + check_errors_in_children(0); + return bb_got_signal; + } return EXIT_SUCCESS; -#endif } |