Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.busybox.net/busybox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/fsync.c3
-rw-r--r--coreutils/md5_sha1_sum.c6
-rw-r--r--coreutils/tail.c3
-rw-r--r--coreutils/touch.c4
-rw-r--r--coreutils/wc.c2
5 files changed, 13 insertions, 5 deletions
diff --git a/coreutils/fsync.c b/coreutils/fsync.c
index f00803c5b..53900f8d2 100644
--- a/coreutils/fsync.c
+++ b/coreutils/fsync.c
@@ -7,6 +7,9 @@
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include "libbb.h"
+#ifndef O_NOATIME
+# define O_NOATIME 0
+#endif
/* This is a NOFORK applet. Be very careful! */
diff --git a/coreutils/md5_sha1_sum.c b/coreutils/md5_sha1_sum.c
index a64026d3d..3d50bb0f5 100644
--- a/coreutils/md5_sha1_sum.c
+++ b/coreutils/md5_sha1_sum.c
@@ -101,8 +101,10 @@ int md5_sha1_sum_main(int argc UNUSED_PARAM, char **argv)
unsigned flags;
/*hash_algo_t hash_algo = applet_name[3];*/
- if (ENABLE_FEATURE_MD5_SHA1_SUM_CHECK)
- flags = getopt32(argv, "scw");
+ if (ENABLE_FEATURE_MD5_SHA1_SUM_CHECK) {
+ /* -b "binary", -t "text" are ignored (shaNNNsum compat) */
+ flags = getopt32(argv, "scwbt");
+ }
else optind = 1;
argv += optind;
//argc -= optind;
diff --git a/coreutils/tail.c b/coreutils/tail.c
index 0be166315..c9d86f459 100644
--- a/coreutils/tail.c
+++ b/coreutils/tail.c
@@ -241,7 +241,8 @@ int tail_main(int argc, char **argv)
} while (nwrite);
}
}
- xwrite(STDOUT_FILENO, buf + nread - nwrite, nwrite);
+ if (nwrite > 0)
+ xwrite(STDOUT_FILENO, buf + nread - nwrite, nwrite);
} else if (count) {
if (COUNT_BYTES) {
taillen += nread;
diff --git a/coreutils/touch.c b/coreutils/touch.c
index 3f7b265bd..dceb7c1cc 100644
--- a/coreutils/touch.c
+++ b/coreutils/touch.c
@@ -104,7 +104,7 @@ int touch_main(int argc UNUSED_PARAM, char **argv)
}
do {
- if (utimes(*argv, reference_file ? timebuf : NULL) != 0) {
+ if (utimes(*argv, (reference_file || date_str) ? timebuf : NULL) != 0) {
if (errno == ENOENT) { /* no such file */
if (opts) { /* creation is disabled, so ignore */
continue;
@@ -113,7 +113,7 @@ int touch_main(int argc UNUSED_PARAM, char **argv)
fd = open(*argv, O_RDWR | O_CREAT, 0666);
if (fd >= 0) {
xclose(fd);
- if (reference_file)
+ if (reference_file || date_str)
utimes(*argv, timebuf);
continue;
}
diff --git a/coreutils/wc.c b/coreutils/wc.c
index 08f3c2dc4..711684225 100644
--- a/coreutils/wc.c
+++ b/coreutils/wc.c
@@ -88,6 +88,8 @@ int wc_main(int argc UNUSED_PARAM, char **argv)
if (!argv[0]) {
*--argv = (char *) bb_msg_standard_input;
fname_fmt = "\n";
+ }
+ if (!argv[1]) { /* zero or one filename? */
if (!((print_type-1) & print_type)) /* exactly one option? */
start_fmt = "%"COUNT_FMT;
}