summaryrefslogtreecommitdiff
path: root/package/busybox
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2007-10-05 00:38:19 +0000
committerFelix Fietkau <nbd@openwrt.org>2007-10-05 00:38:19 +0000
commit2e5ae70cc58999a009a99100af7411eeae442424 (patch)
tree2403b56edd448bca6a38b6cc440b664bbc5e7b2c /package/busybox
parentfe313941ac5ef2a4e80d22be43a9d5dc667276b7 (diff)
downloadmtk-20170518-2e5ae70cc58999a009a99100af7411eeae442424.zip
mtk-20170518-2e5ae70cc58999a009a99100af7411eeae442424.tar.gz
mtk-20170518-2e5ae70cc58999a009a99100af7411eeae442424.tar.bz2
add upstream fixes for 1.7.2
SVN-Revision: 9131
Diffstat (limited to 'package/busybox')
-rw-r--r--package/busybox/patches/990-upstream_tail_fix.patch40
-rw-r--r--package/busybox/patches/991-upstream_logger_fix.patch26
2 files changed, 66 insertions, 0 deletions
diff --git a/package/busybox/patches/990-upstream_tail_fix.patch b/package/busybox/patches/990-upstream_tail_fix.patch
new file mode 100644
index 0000000..ffae223
--- /dev/null
+++ b/package/busybox/patches/990-upstream_tail_fix.patch
@@ -0,0 +1,40 @@
+diff -urN busybox-1.7.2/coreutils/tail.c busybox-1.7.2-tail/coreutils/tail.c
+--- busybox-1.7.2/coreutils/tail.c 2007-09-03 12:48:40.000000000 +0100
++++ busybox-1.7.2-tail/coreutils/tail.c 2007-10-02 11:16:28.000000000 +0100
+@@ -47,13 +47,16 @@
+ static ssize_t tail_read(int fd, char *buf, size_t count)
+ {
+ ssize_t r;
+- off_t current, end;
++ off_t current;
+ struct stat sbuf;
+
+- end = current = lseek(fd, 0, SEEK_CUR);
+- if (!fstat(fd, &sbuf))
+- end = sbuf.st_size;
+- lseek(fd, end < current ? 0 : current, SEEK_SET);
++ /* (A good comment is missing here) */
++ current = lseek(fd, 0, SEEK_CUR);
++ /* /proc files report zero st_size, don't lseek them. */
++ if (fstat(fd, &sbuf) == 0 && sbuf.st_size)
++ if (sbuf.st_size < current)
++ lseek(fd, 0, SEEK_SET);
++
+ r = safe_read(fd, buf, count);
+ if (r < 0) {
+ bb_perror_msg(bb_msg_read_error);
+@@ -67,8 +70,12 @@
+
+ static unsigned eat_num(const char *p)
+ {
+- if (*p == '-') p++;
+- else if (*p == '+') { p++; G.status = EXIT_FAILURE; }
++ if (*p == '-')
++ p++;
++ else if (*p == '+') {
++ p++;
++ G.status = EXIT_FAILURE;
++ }
+ return xatou_sfx(p, tail_suffixes);
+ }
+
diff --git a/package/busybox/patches/991-upstream_logger_fix.patch b/package/busybox/patches/991-upstream_logger_fix.patch
new file mode 100644
index 0000000..e02123b
--- /dev/null
+++ b/package/busybox/patches/991-upstream_logger_fix.patch
@@ -0,0 +1,26 @@
+diff -urN busybox-1.7.2/sysklogd/logger.c busybox-1.7.2-logger/sysklogd/logger.c
+--- busybox-1.7.2/sysklogd/logger.c 2007-09-03 12:48:35.000000000 +0100
++++ busybox-1.7.2-logger/sysklogd/logger.c 2007-10-02 10:56:53.000000000 +0100
+@@ -107,7 +107,7 @@
+ argv += optind;
+ if (!argc) {
+ #define strbuf bb_common_bufsiz1
+- while (fgets(strbuf, BUFSIZ, stdin)) {
++ while (fgets(strbuf, COMMON_BUFSIZE, stdin)) {
+ if (strbuf[0]
+ && NOT_LONE_CHAR(strbuf, '\n')
+ ) {
+@@ -117,11 +117,11 @@
+ }
+ } else {
+ char *message = NULL;
+- int len = 1; /* for NUL */
++ int len = 0;
+ int pos = 0;
+ do {
+ len += strlen(*argv) + 1;
+- message = xrealloc(message, len);
++ message = xrealloc(message, len + 1);
+ sprintf(message + pos, " %s", *argv),
+ pos = len;
+ } while (*++argv);