svn commit: trunk/busybox: coreutils networking procps

vda at busybox.net vda at busybox.net
Tue Oct 16 15:53:05 PDT 2007


Author: vda
Date: 2007-10-16 15:53:05 -0700 (Tue, 16 Oct 2007)
New Revision: 20268

Log:
fixes revealed by randomconfig run



Modified:
   trunk/busybox/coreutils/stat.c
   trunk/busybox/networking/telnetd.c
   trunk/busybox/procps/top.c


Changeset:
Modified: trunk/busybox/coreutils/stat.c
===================================================================
--- trunk/busybox/coreutils/stat.c	2007-10-16 22:01:23 UTC (rev 20267)
+++ trunk/busybox/coreutils/stat.c	2007-10-16 22:53:05 UTC (rev 20268)
@@ -119,6 +119,7 @@
 	return humantypes[i].fs;
 }
 
+#if ENABLE_FEATURE_STAT_FORMAT
 static void strcatc(char *str, char c)
 {
 	int len = strlen(str);
@@ -132,7 +133,6 @@
 	printf(pformat, msg);
 }
 
-#if ENABLE_FEATURE_STAT_FORMAT
 /* print statfs info */
 static void print_statfs(char *pformat, const char m,
 		const char *const filename, const void *data

Modified: trunk/busybox/networking/telnetd.c
===================================================================
--- trunk/busybox/networking/telnetd.c	2007-10-16 22:01:23 UTC (rev 20267)
+++ trunk/busybox/networking/telnetd.c	2007-10-16 22:53:05 UTC (rev 20268)
@@ -492,7 +492,11 @@
 	while (ts) {
 		struct tsession *next = ts->next; /* in case we free ts. */
 		if (ts->shell_pid == -1) {
+#if !ENABLE_FEATURE_TELNETD_STANDALONE
+			return 0;
+#else
 			free_session(ts);
+#endif
 		} else {
 			if (ts->size1 > 0)       /* can write to pty */
 				FD_SET(ts->ptyfd, &wrfdset);
@@ -552,8 +556,6 @@
 			if (count < 0) {
 				if (errno == EAGAIN)
 					goto skip1;
-				if (IS_INETD)
-					return 0;
 				goto kill_session;
 			}
 			ts->size1 -= count;
@@ -569,8 +571,6 @@
 			if (count < 0) {
 				if (errno == EAGAIN)
 					goto skip2;
-				if (IS_INETD)
-					return 0;
 				goto kill_session;
 			}
 			ts->size2 -= count;
@@ -601,8 +601,6 @@
 			if (count <= 0) {
 				if (count < 0 && errno == EAGAIN)
 					goto skip3;
-				if (IS_INETD)
-					return 0;
 				goto kill_session;
 			}
 			/* Ignore trailing NUL if it is there */
@@ -622,8 +620,6 @@
 			if (count <= 0) {
 				if (count < 0 && errno == EAGAIN)
 					goto skip4;
-				if (IS_INETD)
-					return 0;
 				goto kill_session;
 			}
 			ts->size2 += count;
@@ -635,8 +631,14 @@
 		ts = next;
 		continue;
  kill_session:
+#if !ENABLE_FEATURE_TELNETD_STANDALONE
+		return 0;
+#else
+ 		if (IS_INETD)
+			return 0;
 		free_session(ts);
 		ts = next;
+#endif
 	}
 
 	goto again;

Modified: trunk/busybox/procps/top.c
===================================================================
--- trunk/busybox/procps/top.c	2007-10-16 22:01:23 UTC (rev 20267)
+++ trunk/busybox/procps/top.c	2007-10-16 22:53:05 UTC (rev 20268)
@@ -82,10 +82,12 @@
 	/* int hist_iterations; */
 	unsigned total_pcpu;
 	/* unsigned long total_vsz; */
+#endif
 	char line_buf[80];
-#endif
 };
+
 enum { LINE_BUF_SIZE = COMMON_BUFSIZE - offsetof(struct globals, line_buf) };
+
 #define G (*(struct globals*)&bb_common_bufsiz1)
 #define INIT_G() \
 	do { \



More information about the busybox-cvs mailing list