summaryrefslogtreecommitdiff
path: root/coreutils/dd.c
diff options
context:
space:
mode:
authorDenis Vlasenko2008-03-12 23:19:35 +0000
committerDenis Vlasenko2008-03-12 23:19:35 +0000
commit8e2cfec1cdf34068f2378aae9fe8f5ec0f821e21 (patch)
treecf328e6b8bbdc608228da528f661124e364edb85 /coreutils/dd.c
parent4cf1d08fc2e50f9abda999d468c5e972ff4995c2 (diff)
downloadbusybox-8e2cfec1cdf34068f2378aae9fe8f5ec0f821e21.zip
busybox-8e2cfec1cdf34068f2378aae9fe8f5ec0f821e21.tar.gz
libbb: introduse and use signal_[no_]SA_RESTART_empty_mask and sigaction_set
signal_SA_RESTART_empty_mask - 65 +65 signal_no_SA_RESTART_empty_mask - 54 +54 dd_main 1325 1369 +44 sigaction_set - 19 +19 dname_enc 373 377 +4 UNSPEC_print 64 66 +2 setsignal 296 294 -2 bb_signals_recursive 95 92 -3 bb_askpass 367 361 -6 inetd_main 1810 1797 -13 rx_main 912 883 -29 sigdelset 32 - -32 __sigdelset 32 - -32 __GI_sigdelset 32 - -32 sighup_handler 84 37 -47 arping_main 1844 1797 -47 fsck_main 1869 1807 -62 run_list 1917 1844 -73 vlock_main 492 409 -83 progressmeter 883 798 -85 handle_incoming_and_exit 2737 2651 -86 ------------------------------------------------------------------------------ (add/remove: 3/3 grow/shrink: 3/12 up/down: 188/-632) Total: -444 bytes
Diffstat (limited to 'coreutils/dd.c')
-rw-r--r--coreutils/dd.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/coreutils/dd.c b/coreutils/dd.c
index 961b1ff..f3330e6 100644
--- a/coreutils/dd.c
+++ b/coreutils/dd.c
@@ -121,9 +121,6 @@ int dd_main(int argc, char **argv)
off_t count;
off_t seek, skip;
const char *infile, *outfile;
-#if ENABLE_FEATURE_DD_SIGNAL_HANDLING
- struct sigaction sigact;
-#endif
} Z;
#define flags (Z.flags )
#define oc (Z.oc )
@@ -132,17 +129,13 @@ int dd_main(int argc, char **argv)
#define skip (Z.skip )
#define infile (Z.infile )
#define outfile (Z.outfile)
-#define sigact (Z.sigact )
memset(&Z, 0, sizeof(Z));
INIT_G();
//fflush(NULL); - is this needed because of NOEXEC?
#if ENABLE_FEATURE_DD_SIGNAL_HANDLING
- sigact.sa_handler = dd_output_status;
- sigact.sa_flags = SA_RESTART;
- /*sigemptyset(&sigact.sa_mask); - memset did it */
- sigaction(SIGUSR1, &sigact, NULL);
+ signal_SA_RESTART_empty_mask(SIGUSR1, dd_output_status);
#endif
for (n = 1; n < argc; n++) {