diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-10-12 19:29:44 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-10-12 19:29:44 +0000 |
commit | a6dbb08a48903cb8f31fad2cf2d1cffa92bd4808 (patch) | |
tree | f7f2113941a2dc0385080baa7656ead41f45f834 | |
parent | 12f5676cce3b2e04668df3f18f94f1a3c7fdbb9e (diff) | |
download | busybox-w32-a6dbb08a48903cb8f31fad2cf2d1cffa92bd4808.tar.gz busybox-w32-a6dbb08a48903cb8f31fad2cf2d1cffa92bd4808.tar.bz2 busybox-w32-a6dbb08a48903cb8f31fad2cf2d1cffa92bd4808.zip |
small style fixes
-rw-r--r-- | archival/dpkg.c | 10 | ||||
-rw-r--r-- | archival/tar.c | 2 | ||||
-rw-r--r-- | editors/patch.c | 6 | ||||
-rw-r--r-- | libbb/fgets_str.c | 8 | ||||
-rw-r--r-- | libbb/procps.c | 3 | ||||
-rw-r--r-- | libbb/xfuncs.c | 3 | ||||
-rw-r--r-- | networking/ftpgetput.c | 2 | ||||
-rw-r--r-- | networking/udhcp/dhcpc.c | 6 |
8 files changed, 24 insertions, 16 deletions
diff --git a/archival/dpkg.c b/archival/dpkg.c index b55822460..825a8c1d2 100644 --- a/archival/dpkg.c +++ b/archival/dpkg.c | |||
@@ -878,7 +878,8 @@ static void write_status_file(deb_file_t **deb_file) | |||
878 | /* remove trailing \n's */ | 878 | /* remove trailing \n's */ |
879 | write_buffer_no_status(new_status_file, deb_file[i]->control_file); | 879 | write_buffer_no_status(new_status_file, deb_file[i]->control_file); |
880 | set_status(status_num, "ok", 2); | 880 | set_status(status_num, "ok", 2); |
881 | fprintf(new_status_file, "Status: %s\n\n", name_hashtable[status_hashtable[status_num]->status]); | 881 | fprintf(new_status_file, "Status: %s\n\n", |
882 | name_hashtable[status_hashtable[status_num]->status]); | ||
882 | write_flag = TRUE; | 883 | write_flag = TRUE; |
883 | break; | 884 | break; |
884 | } | 885 | } |
@@ -886,7 +887,9 @@ static void write_status_file(deb_file_t **deb_file) | |||
886 | } | 887 | } |
887 | /* This is temperary, debugging only */ | 888 | /* This is temperary, debugging only */ |
888 | if (deb_file[i] == NULL) { | 889 | if (deb_file[i] == NULL) { |
889 | 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); | 890 | bb_error_msg_and_die("ALERT: cannot find a control file, " |
891 | "your status file may be broken, status may be " | ||
892 | "incorrect for %s", package_name); | ||
890 | } | 893 | } |
891 | } | 894 | } |
892 | else if (strcmp("not-installed", name_hashtable[state_status]) == 0) { | 895 | else if (strcmp("not-installed", name_hashtable[state_status]) == 0) { |
@@ -963,7 +966,8 @@ static void write_status_file(deb_file_t **deb_file) | |||
963 | } | 966 | } |
964 | 967 | ||
965 | if (rename("/var/lib/dpkg/status.udeb", "/var/lib/dpkg/status") == -1) { | 968 | if (rename("/var/lib/dpkg/status.udeb", "/var/lib/dpkg/status") == -1) { |
966 | bb_error_msg_and_die("DANGER: Cannot create status file, you need to manually repair your status file"); | 969 | bb_error_msg_and_die("DANGER: cannot create status file, " |
970 | "you need to manually repair your status file"); | ||
967 | } | 971 | } |
968 | } | 972 | } |
969 | 973 | ||
diff --git a/archival/tar.c b/archival/tar.c index 28bb14776..5ebb3dff4 100644 --- a/archival/tar.c +++ b/archival/tar.c | |||
@@ -499,7 +499,7 @@ static int writeTarFile(const int tar_fd, const int verboseFlag, | |||
499 | bb_error_msg("Error exit delayed from previous errors"); | 499 | bb_error_msg("Error exit delayed from previous errors"); |
500 | 500 | ||
501 | if (gzipPid && waitpid(gzipPid, NULL, 0)==-1) | 501 | if (gzipPid && waitpid(gzipPid, NULL, 0)==-1) |
502 | bb_error_msg("Couldnt wait"); | 502 | bb_error_msg("cannot wait"); |
503 | 503 | ||
504 | return !errorFlag; | 504 | return !errorFlag; |
505 | } | 505 | } |
diff --git a/editors/patch.c b/editors/patch.c index 047de9e57..9336b275a 100644 --- a/editors/patch.c +++ b/editors/patch.c | |||
@@ -147,7 +147,7 @@ int patch_main(int argc, char **argv) | |||
147 | strcpy(backup_filename, new_filename); | 147 | strcpy(backup_filename, new_filename); |
148 | strcat(backup_filename, ".orig"); | 148 | strcat(backup_filename, ".orig"); |
149 | if (rename(new_filename, backup_filename) == -1) { | 149 | if (rename(new_filename, backup_filename) == -1) { |
150 | bb_perror_msg_and_die("Couldnt create file %s", | 150 | bb_perror_msg_and_die("cannot create file %s", |
151 | backup_filename); | 151 | backup_filename); |
152 | } | 152 | } |
153 | dst_stream = xfopen(new_filename, "w"); | 153 | dst_stream = xfopen(new_filename, "w"); |
@@ -256,10 +256,10 @@ int patch_main(int argc, char **argv) | |||
256 | if ((dest_cur_line == 0) || (dest_beg_line == 0)) { | 256 | if ((dest_cur_line == 0) || (dest_beg_line == 0)) { |
257 | /* The new patched file is empty, remove it */ | 257 | /* The new patched file is empty, remove it */ |
258 | if (unlink(new_filename) == -1) { | 258 | if (unlink(new_filename) == -1) { |
259 | bb_perror_msg_and_die("Couldnt remove file %s", new_filename); | 259 | bb_perror_msg_and_die("cannot remove file %s", new_filename); |
260 | } | 260 | } |
261 | if (unlink(original_filename) == -1) { | 261 | if (unlink(original_filename) == -1) { |
262 | bb_perror_msg_and_die("Couldnt remove original file %s", new_filename); | 262 | bb_perror_msg_and_die("cannot remove original file %s", new_filename); |
263 | } | 263 | } |
264 | } | 264 | } |
265 | } | 265 | } |
diff --git a/libbb/fgets_str.c b/libbb/fgets_str.c index 8f06fa59c..41370d176 100644 --- a/libbb/fgets_str.c +++ b/libbb/fgets_str.c | |||
@@ -44,12 +44,14 @@ char *fgets_str(FILE *file, const char *terminating_string) | |||
44 | 44 | ||
45 | /* Check for terminating string */ | 45 | /* Check for terminating string */ |
46 | end_string_offset = idx - term_length; | 46 | end_string_offset = idx - term_length; |
47 | if ((end_string_offset > 0) && (memcmp(&linebuf[end_string_offset], terminating_string, term_length) == 0)) { | 47 | if (end_string_offset > 0 |
48 | && memcmp(&linebuf[end_string_offset], terminating_string, term_length) == 0 | ||
49 | ) { | ||
48 | idx -= term_length; | 50 | idx -= term_length; |
49 | break; | 51 | break; |
50 | } | 52 | } |
51 | } | 53 | } |
54 | linebuf = xrealloc(linebuf, idx + 1); | ||
52 | linebuf[idx] = '\0'; | 55 | linebuf[idx] = '\0'; |
53 | return(linebuf); | 56 | return linebuf; |
54 | } | 57 | } |
55 | |||
diff --git a/libbb/procps.c b/libbb/procps.c index 8fd5c1f86..2bcd2cced 100644 --- a/libbb/procps.c +++ b/libbb/procps.c | |||
@@ -54,7 +54,8 @@ procps_status_t * procps_scan(int save_user_arg0) | |||
54 | dir = xopendir("/proc"); | 54 | dir = xopendir("/proc"); |
55 | } | 55 | } |
56 | for (;;) { | 56 | for (;;) { |
57 | if ((entry = readdir(dir)) == NULL) { | 57 | entry = readdir(dir); |
58 | if (entry == NULL) { | ||
58 | closedir(dir); | 59 | closedir(dir); |
59 | dir = 0; | 60 | dir = 0; |
60 | return 0; | 61 | return 0; |
diff --git a/libbb/xfuncs.c b/libbb/xfuncs.c index 84281105c..d22cd279a 100644 --- a/libbb/xfuncs.c +++ b/libbb/xfuncs.c | |||
@@ -137,7 +137,8 @@ void xwrite(int fd, void *buf, size_t count) | |||
137 | // Die with an error message if we can't lseek to the right spot. | 137 | // Die with an error message if we can't lseek to the right spot. |
138 | void xlseek(int fd, off_t offset, int whence) | 138 | void xlseek(int fd, off_t offset, int whence) |
139 | { | 139 | { |
140 | if (offset != lseek(fd, offset, whence)) bb_error_msg_and_die("lseek"); | 140 | if (offset != lseek(fd, offset, whence)) |
141 | bb_error_msg_and_die("lseek"); | ||
141 | } | 142 | } |
142 | 143 | ||
143 | // Die with an error message if we can't read one character. | 144 | // Die with an error message if we can't read one character. |
diff --git a/networking/ftpgetput.c b/networking/ftpgetput.c index 5d13e289b..47126ee83 100644 --- a/networking/ftpgetput.c +++ b/networking/ftpgetput.c | |||
@@ -78,7 +78,7 @@ static FILE *ftp_login(ftp_host_info_t *server) | |||
78 | /* Connect to the command socket */ | 78 | /* Connect to the command socket */ |
79 | control_stream = fdopen(xconnect(server->s_in), "r+"); | 79 | control_stream = fdopen(xconnect(server->s_in), "r+"); |
80 | if (control_stream == NULL) { | 80 | if (control_stream == NULL) { |
81 | bb_perror_msg_and_die("Couldnt open control stream"); | 81 | bb_perror_msg_and_die("cannot open control stream"); |
82 | } | 82 | } |
83 | 83 | ||
84 | if (ftpcmd(NULL, NULL, control_stream, buf) != 220) { | 84 | if (ftpcmd(NULL, NULL, control_stream, buf) != 220) { |
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c index f2cf82f05..e2ddf4fb1 100644 --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c | |||
@@ -448,7 +448,7 @@ int udhcpc_main(int argc, char *argv[]) | |||
448 | } | 448 | } |
449 | 449 | ||
450 | if ((message = get_option(&packet, DHCP_MESSAGE_TYPE)) == NULL) { | 450 | if ((message = get_option(&packet, DHCP_MESSAGE_TYPE)) == NULL) { |
451 | bb_error_msg("Couldnt get option from packet - ignoring"); | 451 | bb_error_msg("cannot get option from packet - ignoring"); |
452 | continue; | 452 | continue; |
453 | } | 453 | } |
454 | 454 | ||
@@ -467,7 +467,7 @@ int udhcpc_main(int argc, char *argv[]) | |||
467 | timeout = now; | 467 | timeout = now; |
468 | packet_num = 0; | 468 | packet_num = 0; |
469 | } else { | 469 | } else { |
470 | bb_error_msg("No server ID in message"); | 470 | bb_error_msg("no server ID in message"); |
471 | } | 471 | } |
472 | } | 472 | } |
473 | break; | 473 | break; |
@@ -478,7 +478,7 @@ int udhcpc_main(int argc, char *argv[]) | |||
478 | if (*message == DHCPACK) { | 478 | if (*message == DHCPACK) { |
479 | temp = get_option(&packet, DHCP_LEASE_TIME); | 479 | temp = get_option(&packet, DHCP_LEASE_TIME); |
480 | if (!temp) { | 480 | if (!temp) { |
481 | bb_error_msg("No lease time with ACK, using 1 hour lease"); | 481 | bb_error_msg("no lease time with ACK, using 1 hour lease"); |
482 | lease = 60 * 60; | 482 | lease = 60 * 60; |
483 | } else { | 483 | } else { |
484 | lease = ntohl(*(uint32_t*)temp); | 484 | lease = ntohl(*(uint32_t*)temp); |