diff options
author | Ron Yorston <rmy@pobox.com> | 2018-04-09 08:50:34 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2018-04-09 08:50:34 +0100 |
commit | 921c1ab66bad54d4ad8591bb74e41ac985248496 (patch) | |
tree | 552a04c691e78e78570e4ec2c83fbc0e59953924 /miscutils | |
parent | 5b6f06f5eb8628955262508d153627fe6f2d1c8b (diff) | |
parent | a1870f4807a75663a085c9f5e92870fa7554f0ad (diff) | |
download | busybox-w32-921c1ab66bad54d4ad8591bb74e41ac985248496.tar.gz busybox-w32-921c1ab66bad54d4ad8591bb74e41ac985248496.tar.bz2 busybox-w32-921c1ab66bad54d4ad8591bb74e41ac985248496.zip |
Merge branch 'busybox' into merge
Diffstat (limited to 'miscutils')
-rw-r--r-- | miscutils/bbconfig.c | 19 | ||||
-rw-r--r-- | miscutils/i2c_tools.c | 3 | ||||
-rw-r--r-- | miscutils/time.c | 1 |
3 files changed, 15 insertions, 8 deletions
diff --git a/miscutils/bbconfig.c b/miscutils/bbconfig.c index 2151c622c..aa42de648 100644 --- a/miscutils/bbconfig.c +++ b/miscutils/bbconfig.c | |||
@@ -45,13 +45,22 @@ int bbconfig_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) | |||
45 | { | 45 | { |
46 | #if ENABLE_FEATURE_COMPRESS_BBCONFIG | 46 | #if ENABLE_FEATURE_COMPRESS_BBCONFIG |
47 | bunzip_data *bd; | 47 | bunzip_data *bd; |
48 | int i = start_bunzip(&bd, | 48 | int i; |
49 | jmp_buf jmpbuf; | ||
50 | |||
51 | /* Setup for I/O error handling via longjmp */ | ||
52 | i = setjmp(jmpbuf); | ||
53 | if (i == 0) { | ||
54 | i = start_bunzip(&jmpbuf, | ||
55 | &bd, | ||
49 | /* src_fd: */ -1, | 56 | /* src_fd: */ -1, |
50 | /* inbuf: */ bbconfig_config_bz2, | 57 | /* inbuf: */ bbconfig_config_bz2, |
51 | /* len: */ sizeof(bbconfig_config_bz2)); | 58 | /* len: */ sizeof(bbconfig_config_bz2) |
52 | /* read_bunzip can longjmp to start_bunzip, and ultimately | 59 | ); |
53 | * end up here with i != 0 on read data errors! Not trivial */ | 60 | } |
54 | if (!i) { | 61 | /* read_bunzip can longjmp and end up here with i != 0 |
62 | * on read data errors! Not trivial */ | ||
63 | if (i == 0) { | ||
55 | /* Cannot use xmalloc: will leak bd in NOFORK case! */ | 64 | /* Cannot use xmalloc: will leak bd in NOFORK case! */ |
56 | char *outbuf = malloc_or_warn(sizeof(bbconfig_config)); | 65 | char *outbuf = malloc_or_warn(sizeof(bbconfig_config)); |
57 | if (outbuf) { | 66 | if (outbuf) { |
diff --git a/miscutils/i2c_tools.c b/miscutils/i2c_tools.c index 82f9842bd..6a2134063 100644 --- a/miscutils/i2c_tools.c +++ b/miscutils/i2c_tools.c | |||
@@ -421,8 +421,7 @@ static void check_write_funcs(int fd, int mode, int pec) | |||
421 | static void confirm_or_abort(void) | 421 | static void confirm_or_abort(void) |
422 | { | 422 | { |
423 | fprintf(stderr, "Continue? [y/N] "); | 423 | fprintf(stderr, "Continue? [y/N] "); |
424 | fflush_all(); | 424 | if (!bb_ask_y_confirmation()) |
425 | if (!bb_ask_confirmation()) | ||
426 | bb_error_msg_and_die("aborting"); | 425 | bb_error_msg_and_die("aborting"); |
427 | } | 426 | } |
428 | 427 | ||
diff --git a/miscutils/time.c b/miscutils/time.c index 61f078755..7d6a7a29f 100644 --- a/miscutils/time.c +++ b/miscutils/time.c | |||
@@ -32,7 +32,6 @@ | |||
32 | //usage: "\n -a Append (else overwrite)" | 32 | //usage: "\n -a Append (else overwrite)" |
33 | 33 | ||
34 | #include "libbb.h" | 34 | #include "libbb.h" |
35 | #include <sys/resource.h> /* getrusage */ | ||
36 | 35 | ||
37 | /* Information on the resources used by a child process. */ | 36 | /* Information on the resources used by a child process. */ |
38 | typedef struct { | 37 | typedef struct { |