diff options
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/cmp.c | 2 | ||||
-rw-r--r-- | coreutils/touch.c | 13 |
2 files changed, 5 insertions, 10 deletions
diff --git a/coreutils/cmp.c b/coreutils/cmp.c index cff118279..c70f8822d 100644 --- a/coreutils/cmp.c +++ b/coreutils/cmp.c @@ -30,7 +30,7 @@ static FILE *cmp_xfopen_input(const char * const filename) fp = fopen_or_warn_stdin(filename); if (fp) return fp; - exit(xfunc_error_retval); /* We already output an error message. */ + sleep_and_die(); /* We already output an error message. */ } static const char fmt_eof[] = "cmp: EOF on %s\n"; diff --git a/coreutils/touch.c b/coreutils/touch.c index ae4e689f1..5f81b2380 100644 --- a/coreutils/touch.c +++ b/coreutils/touch.c @@ -17,21 +17,16 @@ * Also, exiting on a failure was a bug. All args should be processed. */ -#include <stdio.h> -#include <sys/types.h> -#include <fcntl.h> -#include <utime.h> -#include <errno.h> -#include <unistd.h> -#include <stdlib.h> #include "busybox.h" +/* This is a NOFORK applet. Be very careful! */ + int touch_main(int argc, char **argv); int touch_main(int argc, char **argv) { int fd; int status = EXIT_SUCCESS; - bool flags = (getopt32(argc, argv, "c") & 1); + int flags = getopt32(argc, argv, "c"); argv += optind; @@ -41,7 +36,7 @@ int touch_main(int argc, char **argv) do { if (utime(*argv, NULL)) { - if (errno == ENOENT) { /* no such file*/ + if (errno == ENOENT) { /* no such file */ if (flags) { /* Creation is disabled, so ignore. */ continue; } |