aboutsummaryrefslogtreecommitdiff
path: root/archival/rpm2cpio.c
diff options
context:
space:
mode:
Diffstat (limited to 'archival/rpm2cpio.c')
-rw-r--r--archival/rpm2cpio.c35
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)
42 return sizeof(header) + len; 42 return sizeof(header) + len;
43} 43}
44 44
45#if SEAMLESS_COMPRESSION
46static void handle_SIGCHLD(int signo UNUSED_PARAM)
47{
48 int status;
49
50 /* Wait for any child without blocking */
51 for (;;) {
52 if (wait_any_nohang(&status) < 0)
53 /* wait failed?! I'm confused... */
54 return;
55 if (WIFEXITED(status) && WEXITSTATUS(status) == 0)
56 /* this child exited with 0 */
57 continue;
58 /* Cannot happen?
59 if (!WIFSIGNALED(status) && !WIFEXITED(status)) ???; */
60 bb_got_signal = 1;
61 }
62}
63#endif
64
65/* No getopt required */ 45/* No getopt required */
66int rpm2cpio_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 46int rpm2cpio_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
67int rpm2cpio_main(int argc UNUSED_PARAM, char **argv) 47int rpm2cpio_main(int argc UNUSED_PARAM, char **argv)
@@ -86,10 +66,9 @@ int rpm2cpio_main(int argc UNUSED_PARAM, char **argv)
86 /* Skip the main header */ 66 /* Skip the main header */
87 skip_header(); 67 skip_header();
88 68
89#if SEAMLESS_COMPRESSION 69 //if (SEAMLESS_COMPRESSION)
90 /* We need to know whether child (gzip/bzip/etc) exits abnormally */ 70 // /* We need to know whether child (gzip/bzip/etc) exits abnormally */
91 signal(SIGCHLD, handle_SIGCHLD); 71 // signal(SIGCHLD, check_errors_in_children);
92#endif
93 72
94 /* This works, but doesn't report uncompress errors (they happen in child) */ 73 /* This works, but doesn't report uncompress errors (they happen in child) */
95 setup_unzip_on_fd(rpm_fd, /*fail_if_not_detected:*/ 1); 74 setup_unzip_on_fd(rpm_fd, /*fail_if_not_detected:*/ 1);
@@ -100,9 +79,9 @@ int rpm2cpio_main(int argc UNUSED_PARAM, char **argv)
100 close(rpm_fd); 79 close(rpm_fd);
101 } 80 }
102 81
103#if SEAMLESS_COMPRESSION 82 if (SEAMLESS_COMPRESSION) {
104 return bb_got_signal; 83 check_errors_in_children(0);
105#else 84 return bb_got_signal;
85 }
106 return EXIT_SUCCESS; 86 return EXIT_SUCCESS;
107#endif
108} 87}