diff options
| author | aldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-05-29 12:10:23 +0000 |
|---|---|---|
| committer | aldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-05-29 12:10:23 +0000 |
| commit | e78189465fdad9f28d985477ac05f2c5a3afb280 (patch) | |
| tree | ea8e439001256f7f6da7683399115d009552d777 /coreutils | |
| parent | d4cc0d7783259457083cdd8ded37e20ad232fbd9 (diff) | |
| download | busybox-w32-e78189465fdad9f28d985477ac05f2c5a3afb280.tar.gz busybox-w32-e78189465fdad9f28d985477ac05f2c5a3afb280.tar.bz2 busybox-w32-e78189465fdad9f28d985477ac05f2c5a3afb280.zip | |
- ls: remove unused variable
- dpkg.c, diff: use xstat
text data bss dec hex filename
848823 9100 645216 1503139 16efa3 busybox_old
848679 9100 645216 1502995 16ef13 busybox_unstripped
bloatcheck is completely useless as it sees -79 for this, which is bogus.
git-svn-id: svn://busybox.net/trunk/busybox@15218 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'coreutils')
| -rw-r--r-- | coreutils/diff.c | 14 | ||||
| -rw-r--r-- | coreutils/ls.c | 15 |
2 files changed, 11 insertions, 18 deletions
diff --git a/coreutils/diff.c b/coreutils/diff.c index c9274e64f..a1a74d51e 100644 --- a/coreutils/diff.c +++ b/coreutils/diff.c | |||
| @@ -1237,13 +1237,13 @@ int diff_main(int argc, char **argv) { | |||
| 1237 | if (strcmp(argv[0], "-") == 0) { | 1237 | if (strcmp(argv[0], "-") == 0) { |
| 1238 | fstat(STDIN_FILENO, &stb1); | 1238 | fstat(STDIN_FILENO, &stb1); |
| 1239 | gotstdin = 1; | 1239 | gotstdin = 1; |
| 1240 | } else if (stat(argv[0], &stb1) != 0) | 1240 | } else |
| 1241 | bb_perror_msg_and_die("Couldn't stat %s", argv[0]); | 1241 | xstat(argv[0], &stb1); |
| 1242 | if (strcmp(argv[1], "-") == 0) { | 1242 | if (strcmp(argv[1], "-") == 0) { |
| 1243 | fstat(STDIN_FILENO, &stb2); | 1243 | fstat(STDIN_FILENO, &stb2); |
| 1244 | gotstdin = 1; | 1244 | gotstdin = 1; |
| 1245 | } else if (stat(argv[1], &stb2) != 0) | 1245 | } else |
| 1246 | bb_perror_msg_and_die("Couldn't stat %s", argv[1]); | 1246 | xstat(argv[1], &stb2); |
| 1247 | if (gotstdin && (S_ISDIR(stb1.st_mode) || S_ISDIR(stb2.st_mode))) | 1247 | if (gotstdin && (S_ISDIR(stb1.st_mode) || S_ISDIR(stb2.st_mode))) |
| 1248 | bb_error_msg_and_die("Can't compare - to a directory"); | 1248 | bb_error_msg_and_die("Can't compare - to a directory"); |
| 1249 | if (S_ISDIR(stb1.st_mode) && S_ISDIR(stb2.st_mode)) { | 1249 | if (S_ISDIR(stb1.st_mode) && S_ISDIR(stb2.st_mode)) { |
| @@ -1256,13 +1256,11 @@ int diff_main(int argc, char **argv) { | |||
| 1256 | else { | 1256 | else { |
| 1257 | if (S_ISDIR(stb1.st_mode)) { | 1257 | if (S_ISDIR(stb1.st_mode)) { |
| 1258 | argv[0] = concat_path_file(argv[0], argv[1]); | 1258 | argv[0] = concat_path_file(argv[0], argv[1]); |
| 1259 | if (stat(argv[0], &stb1) < 0) | 1259 | xstat(argv[0], &stb1); |
| 1260 | bb_perror_msg_and_die("Couldn't stat %s", argv[0]); | ||
| 1261 | } | 1260 | } |
| 1262 | if (S_ISDIR(stb2.st_mode)) { | 1261 | if (S_ISDIR(stb2.st_mode)) { |
| 1263 | argv[1] = concat_path_file(argv[1], argv[0]); | 1262 | argv[1] = concat_path_file(argv[1], argv[0]); |
| 1264 | if (stat(argv[1], &stb2) < 0) | 1263 | xstat(argv[1], &stb2); |
| 1265 | bb_perror_msg_and_die("Couldn't stat %s", argv[1]); | ||
| 1266 | } | 1264 | } |
| 1267 | print_status(diffreg(argv[0], argv[1], 0), argv[0], argv[1], NULL); | 1265 | print_status(diffreg(argv[0], argv[1], 0), argv[0], argv[1], NULL); |
| 1268 | } | 1266 | } |
diff --git a/coreutils/ls.c b/coreutils/ls.c index 3fe0c8dad..9c0e8f17d 100644 --- a/coreutils/ls.c +++ b/coreutils/ls.c | |||
| @@ -208,18 +208,15 @@ static struct dnode *my_stat(char *fullname, char *name) | |||
| 208 | #ifdef CONFIG_SELINUX | 208 | #ifdef CONFIG_SELINUX |
| 209 | security_context_t sid=NULL; | 209 | security_context_t sid=NULL; |
| 210 | #endif | 210 | #endif |
| 211 | int rc; | ||
| 212 | 211 | ||
| 213 | #ifdef CONFIG_FEATURE_LS_FOLLOWLINKS | 212 | #ifdef CONFIG_FEATURE_LS_FOLLOWLINKS |
| 214 | if (all_fmt & FOLLOW_LINKS) { | 213 | if (all_fmt & FOLLOW_LINKS) { |
| 215 | #ifdef CONFIG_SELINUX | 214 | #ifdef CONFIG_SELINUX |
| 216 | if (is_selinux_enabled()) { | 215 | if (is_selinux_enabled()) { |
| 217 | rc=0; /* Set the number which means success before hand. */ | 216 | getfilecon(fullname,&sid); |
| 218 | rc = getfilecon(fullname,&sid); | ||
| 219 | } | 217 | } |
| 220 | #endif | 218 | #endif |
| 221 | rc = stat(fullname, &dstat); | 219 | if (stat(fullname, &dstat)) { |
| 222 | if(rc) { | ||
| 223 | bb_perror_msg("%s", fullname); | 220 | bb_perror_msg("%s", fullname); |
| 224 | status = EXIT_FAILURE; | 221 | status = EXIT_FAILURE; |
| 225 | return 0; | 222 | return 0; |
| @@ -229,12 +226,10 @@ static struct dnode *my_stat(char *fullname, char *name) | |||
| 229 | { | 226 | { |
| 230 | #ifdef CONFIG_SELINUX | 227 | #ifdef CONFIG_SELINUX |
| 231 | if (is_selinux_enabled()) { | 228 | if (is_selinux_enabled()) { |
| 232 | rc=0; /* Set the number which means success before hand. */ | 229 | lgetfilecon(fullname,&sid); |
| 233 | rc = lgetfilecon(fullname,&sid); | ||
| 234 | } | 230 | } |
| 235 | #endif | 231 | #endif |
| 236 | rc = lstat(fullname, &dstat); | 232 | if (lstat(fullname, &dstat)) { |
| 237 | if(rc) { | ||
| 238 | bb_perror_msg("%s", fullname); | 233 | bb_perror_msg("%s", fullname); |
| 239 | status = EXIT_FAILURE; | 234 | status = EXIT_FAILURE; |
| 240 | return 0; | 235 | return 0; |
