svn commit: branches/busybox_1_7_stable: coreutils include networking networking etc...
vda at busybox.net
vda at busybox.net
Sat Nov 3 23:17:41 UTC 2007
Author: vda
Date: 2007-11-03 16:17:40 -0700 (Sat, 03 Nov 2007)
New Revision: 20356
Log:
apply accumulated post 1.7.2 patches; bump version to 1.7.3
Modified:
branches/busybox_1_7_stable/Makefile
branches/busybox_1_7_stable/coreutils/tail.c
branches/busybox_1_7_stable/include/libbb.h
branches/busybox_1_7_stable/networking/httpd.c
branches/busybox_1_7_stable/networking/inetd.c
branches/busybox_1_7_stable/networking/libiproute/iptunnel.c
branches/busybox_1_7_stable/shell/ash.c
branches/busybox_1_7_stable/sysklogd/logger.c
Changeset:
Modified: branches/busybox_1_7_stable/Makefile
===================================================================
--- branches/busybox_1_7_stable/Makefile 2007-11-03 07:23:18 UTC (rev 20355)
+++ branches/busybox_1_7_stable/Makefile 2007-11-03 23:17:40 UTC (rev 20356)
@@ -1,6 +1,6 @@
VERSION = 1
PATCHLEVEL = 7
-SUBLEVEL = 2
+SUBLEVEL = 3
EXTRAVERSION =
NAME = Unnamed
Modified: branches/busybox_1_7_stable/coreutils/tail.c
===================================================================
--- branches/busybox_1_7_stable/coreutils/tail.c 2007-11-03 07:23:18 UTC (rev 20355)
+++ branches/busybox_1_7_stable/coreutils/tail.c 2007-11-03 23:17:40 UTC (rev 20356)
@@ -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);
}
Modified: branches/busybox_1_7_stable/include/libbb.h
===================================================================
--- branches/busybox_1_7_stable/include/libbb.h 2007-11-03 07:23:18 UTC (rev 20355)
+++ branches/busybox_1_7_stable/include/libbb.h 2007-11-03 23:17:40 UTC (rev 20356)
@@ -776,7 +776,7 @@
extern void bb_do_delay(int seconds);
extern void change_identity(const struct passwd *pw);
extern const char *change_identity_e2str(const struct passwd *pw);
-extern void run_shell(const char *shell, int loginshell, const char *command, const char **additional_args);
+extern void run_shell(const char *shell, int loginshell, const char *command, const char **additional_args) ATTRIBUTE_NORETURN;
#if ENABLE_SELINUX
extern void renew_current_security_context(void);
extern void set_current_security_context(security_context_t sid);
Modified: branches/busybox_1_7_stable/networking/httpd.c
===================================================================
--- branches/busybox_1_7_stable/networking/httpd.c 2007-11-03 07:23:18 UTC (rev 20355)
+++ branches/busybox_1_7_stable/networking/httpd.c 2007-11-03 23:17:40 UTC (rev 20356)
@@ -1186,6 +1186,9 @@
* and send it to the peer. So please no SIGPIPEs! */
signal(SIGPIPE, SIG_IGN);
+ /* Accound for POSTDATA already in hdr_buf */
+ bodyLen -= hdr_cnt;
+
/* This loop still looks messy. What is an exit criteria?
* "CGI's output closed"? Or "CGI has exited"?
* What to do if CGI has closed both input and output, but
Modified: branches/busybox_1_7_stable/networking/inetd.c
===================================================================
--- branches/busybox_1_7_stable/networking/inetd.c 2007-11-03 07:23:18 UTC (rev 20355)
+++ branches/busybox_1_7_stable/networking/inetd.c 2007-11-03 23:17:40 UTC (rev 20356)
@@ -734,7 +734,8 @@
/* if ((arg = skip(&cp, 1)) == NULL) */
/* goto more; */
- sep->se_server = xxstrdup(skip(&cp));
+ arg = skip(&cp);
+ sep->se_server = xxstrdup(arg);
if (strcmp(sep->se_server, "internal") == 0) {
#ifdef INETD_FEATURE_ENABLED
const struct builtin *bi;
@@ -759,7 +760,7 @@
sep->se_bi = NULL;
#endif
argc = 0;
- for (arg = skip(&cp); cp; arg = skip(&cp)) {
+ for (; cp; arg = skip(&cp)) {
if (argc < MAXARGV)
sep->se_argv[argc++] = xxstrdup(arg);
}
Modified: branches/busybox_1_7_stable/networking/libiproute/iptunnel.c
===================================================================
--- branches/busybox_1_7_stable/networking/libiproute/iptunnel.c 2007-11-03 07:23:18 UTC (rev 20355)
+++ branches/busybox_1_7_stable/networking/libiproute/iptunnel.c 2007-11-03 23:17:40 UTC (rev 20356)
@@ -241,12 +241,12 @@
} else if (key == ARG_remote) {
NEXT_ARG();
key = index_in_strings(keywords, *argv);
- if (key == ARG_any)
+ if (key != ARG_any)
p->iph.daddr = get_addr32(*argv);
} else if (key == ARG_local) {
NEXT_ARG();
key = index_in_strings(keywords, *argv);
- if (key == ARG_any)
+ if (key != ARG_any)
p->iph.saddr = get_addr32(*argv);
} else if (key == ARG_dev) {
NEXT_ARG();
Modified: branches/busybox_1_7_stable/shell/ash.c
===================================================================
--- branches/busybox_1_7_stable/shell/ash.c 2007-11-03 07:23:18 UTC (rev 20355)
+++ branches/busybox_1_7_stable/shell/ash.c 2007-11-03 23:17:40 UTC (rev 20356)
@@ -4379,6 +4379,7 @@
/* Lives far away from here, needed for forkchild */
static void closescript(void);
+
/* Called after fork(), in child */
static void
forkchild(struct job *jp, union node *n, int mode)
@@ -4423,15 +4424,8 @@
setsignal(SIGQUIT);
setsignal(SIGTERM);
}
-#if JOBS
- /* For "jobs | cat" to work like in bash, we must retain list of jobs
- * in child, but we do need to remove ourself */
- if (jp)
- freejob(jp);
-#else
for (jp = curjob; jp; jp = jp->prev_job)
freejob(jp);
-#endif
jobless = 0;
}
Modified: branches/busybox_1_7_stable/sysklogd/logger.c
===================================================================
--- branches/busybox_1_7_stable/sysklogd/logger.c 2007-11-03 07:23:18 UTC (rev 20355)
+++ branches/busybox_1_7_stable/sysklogd/logger.c 2007-11-03 23:17:40 UTC (rev 20356)
@@ -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);
More information about the busybox-cvs
mailing list