svn commit: trunk/busybox: archival editors libbb networking networ etc...

vda at busybox.net vda at busybox.net
Thu Oct 12 19:29:44 UTC 2006


Author: vda
Date: 2006-10-12 12:29:44 -0700 (Thu, 12 Oct 2006)
New Revision: 16371

Log:
small style fixes


Modified:
   trunk/busybox/archival/dpkg.c
   trunk/busybox/archival/tar.c
   trunk/busybox/editors/patch.c
   trunk/busybox/libbb/fgets_str.c
   trunk/busybox/libbb/procps.c
   trunk/busybox/libbb/xfuncs.c
   trunk/busybox/networking/ftpgetput.c
   trunk/busybox/networking/udhcp/dhcpc.c


Changeset:
Modified: trunk/busybox/archival/dpkg.c
===================================================================
--- trunk/busybox/archival/dpkg.c	2006-10-12 06:15:13 UTC (rev 16370)
+++ trunk/busybox/archival/dpkg.c	2006-10-12 19:29:44 UTC (rev 16371)
@@ -878,7 +878,8 @@
 							/* remove trailing \n's */
 							write_buffer_no_status(new_status_file, deb_file[i]->control_file);
 							set_status(status_num, "ok", 2);
-							fprintf(new_status_file, "Status: %s\n\n", name_hashtable[status_hashtable[status_num]->status]);
+							fprintf(new_status_file, "Status: %s\n\n",
+									name_hashtable[status_hashtable[status_num]->status]);
 							write_flag = TRUE;
 							break;
 						}
@@ -886,7 +887,9 @@
 					}
 					/* This is temperary, debugging only */
 					if (deb_file[i] == NULL) {
-						bb_error_msg_and_die("ALERT: Couldnt find a control file, your status file may be broken, status may be incorrect for %s", package_name);
+						bb_error_msg_and_die("ALERT: cannot find a control file, "
+							"your status file may be broken, status may be "
+							"incorrect for %s", package_name);
 					}
 				}
 				else if (strcmp("not-installed", name_hashtable[state_status]) == 0) {
@@ -963,7 +966,8 @@
 	}
 
 	if (rename("/var/lib/dpkg/status.udeb", "/var/lib/dpkg/status") == -1) {
-		bb_error_msg_and_die("DANGER: Cannot create status file, you need to manually repair your status file");
+		bb_error_msg_and_die("DANGER: cannot create status file, "
+			"you need to manually repair your status file");
 	}
 }
 

Modified: trunk/busybox/archival/tar.c
===================================================================
--- trunk/busybox/archival/tar.c	2006-10-12 06:15:13 UTC (rev 16370)
+++ trunk/busybox/archival/tar.c	2006-10-12 19:29:44 UTC (rev 16371)
@@ -499,7 +499,7 @@
 		bb_error_msg("Error exit delayed from previous errors");
 
 	if (gzipPid && waitpid(gzipPid, NULL, 0)==-1)
-		bb_error_msg("Couldnt wait");
+		bb_error_msg("cannot wait");
 
 	return !errorFlag;
 }

Modified: trunk/busybox/editors/patch.c
===================================================================
--- trunk/busybox/editors/patch.c	2006-10-12 06:15:13 UTC (rev 16370)
+++ trunk/busybox/editors/patch.c	2006-10-12 19:29:44 UTC (rev 16371)
@@ -147,7 +147,7 @@
 			strcpy(backup_filename, new_filename);
 			strcat(backup_filename, ".orig");
 			if (rename(new_filename, backup_filename) == -1) {
-				bb_perror_msg_and_die("Couldnt create file %s",
+				bb_perror_msg_and_die("cannot create file %s",
 						backup_filename);
 			}
 			dst_stream = xfopen(new_filename, "w");
@@ -256,10 +256,10 @@
 			if ((dest_cur_line == 0) || (dest_beg_line == 0)) {
 				/* The new patched file is empty, remove it */
 				if (unlink(new_filename) == -1) {
-					bb_perror_msg_and_die("Couldnt remove file %s", new_filename);
+					bb_perror_msg_and_die("cannot remove file %s", new_filename);
 				}
 				if (unlink(original_filename) == -1) {
-					bb_perror_msg_and_die("Couldnt remove original file %s", new_filename);
+					bb_perror_msg_and_die("cannot remove original file %s", new_filename);
 				}
 			}
 		}

Modified: trunk/busybox/libbb/fgets_str.c
===================================================================
--- trunk/busybox/libbb/fgets_str.c	2006-10-12 06:15:13 UTC (rev 16370)
+++ trunk/busybox/libbb/fgets_str.c	2006-10-12 19:29:44 UTC (rev 16371)
@@ -44,12 +44,14 @@
 
 		/* Check for terminating string */
 		end_string_offset = idx - term_length;
-		if ((end_string_offset > 0) && (memcmp(&linebuf[end_string_offset], terminating_string, term_length) == 0)) {
+		if (end_string_offset > 0
+		 && memcmp(&linebuf[end_string_offset], terminating_string, term_length) == 0
+		) {
 			idx -= term_length;
 			break;
 		}
 	}
+	linebuf = xrealloc(linebuf, idx + 1);
 	linebuf[idx] = '\0';
-	return(linebuf);
+	return linebuf;
 }
-

Modified: trunk/busybox/libbb/procps.c
===================================================================
--- trunk/busybox/libbb/procps.c	2006-10-12 06:15:13 UTC (rev 16370)
+++ trunk/busybox/libbb/procps.c	2006-10-12 19:29:44 UTC (rev 16371)
@@ -54,7 +54,8 @@
 		dir = xopendir("/proc");
 	}
 	for (;;) {
-		if ((entry = readdir(dir)) == NULL) {
+		entry = readdir(dir);
+		if (entry == NULL) {
 			closedir(dir);
 			dir = 0;
 			return 0;

Modified: trunk/busybox/libbb/xfuncs.c
===================================================================
--- trunk/busybox/libbb/xfuncs.c	2006-10-12 06:15:13 UTC (rev 16370)
+++ trunk/busybox/libbb/xfuncs.c	2006-10-12 19:29:44 UTC (rev 16371)
@@ -137,7 +137,8 @@
 // Die with an error message if we can't lseek to the right spot.
 void xlseek(int fd, off_t offset, int whence)
 {
-	if (offset != lseek(fd, offset, whence)) bb_error_msg_and_die("lseek");
+	if (offset != lseek(fd, offset, whence))
+		bb_error_msg_and_die("lseek");
 }
 
 // Die with an error message if we can't read one character.

Modified: trunk/busybox/networking/ftpgetput.c
===================================================================
--- trunk/busybox/networking/ftpgetput.c	2006-10-12 06:15:13 UTC (rev 16370)
+++ trunk/busybox/networking/ftpgetput.c	2006-10-12 19:29:44 UTC (rev 16371)
@@ -78,7 +78,7 @@
 	/* Connect to the command socket */
 	control_stream = fdopen(xconnect(server->s_in), "r+");
 	if (control_stream == NULL) {
-		bb_perror_msg_and_die("Couldnt open control stream");
+		bb_perror_msg_and_die("cannot open control stream");
 	}
 
 	if (ftpcmd(NULL, NULL, control_stream, buf) != 220) {

Modified: trunk/busybox/networking/udhcp/dhcpc.c
===================================================================
--- trunk/busybox/networking/udhcp/dhcpc.c	2006-10-12 06:15:13 UTC (rev 16370)
+++ trunk/busybox/networking/udhcp/dhcpc.c	2006-10-12 19:29:44 UTC (rev 16371)
@@ -448,7 +448,7 @@
 			}
 
 			if ((message = get_option(&packet, DHCP_MESSAGE_TYPE)) == NULL) {
-				bb_error_msg("Couldnt get option from packet - ignoring");
+				bb_error_msg("cannot get option from packet - ignoring");
 				continue;
 			}
 
@@ -467,7 +467,7 @@
 						timeout = now;
 						packet_num = 0;
 					} else {
-						bb_error_msg("No server ID in message");
+						bb_error_msg("no server ID in message");
 					}
 				}
 				break;
@@ -478,7 +478,7 @@
 				if (*message == DHCPACK) {
 					temp = get_option(&packet, DHCP_LEASE_TIME);
 					if (!temp) {
-						bb_error_msg("No lease time with ACK, using 1 hour lease");
+						bb_error_msg("no lease time with ACK, using 1 hour lease");
 						lease = 60 * 60;
 					} else {
 						lease = ntohl(*(uint32_t*)temp);




More information about the busybox-cvs mailing list