summaryrefslogtreecommitdiffhomepage
path: root/coreutils
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2006-05-29 12:10:23 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2006-05-29 12:10:23 +0000
commitd2c306e862abf49dd4b1ff1d1bd1a789317b7905 (patch)
treeea8e439001256f7f6da7683399115d009552d777 /coreutils
parent1ec5b2905484b7904aabb01f56c70265fb538c82 (diff)
- 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.
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/diff.c14
-rw-r--r--coreutils/ls.c15
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) {
if (strcmp(argv[0], "-") == 0) {
fstat(STDIN_FILENO, &stb1);
gotstdin = 1;
- } else if (stat(argv[0], &stb1) != 0)
- bb_perror_msg_and_die("Couldn't stat %s", argv[0]);
+ } else
+ xstat(argv[0], &stb1);
if (strcmp(argv[1], "-") == 0) {
fstat(STDIN_FILENO, &stb2);
gotstdin = 1;
- } else if (stat(argv[1], &stb2) != 0)
- bb_perror_msg_and_die("Couldn't stat %s", argv[1]);
+ } else
+ xstat(argv[1], &stb2);
if (gotstdin && (S_ISDIR(stb1.st_mode) || S_ISDIR(stb2.st_mode)))
bb_error_msg_and_die("Can't compare - to a directory");
if (S_ISDIR(stb1.st_mode) && S_ISDIR(stb2.st_mode)) {
@@ -1256,13 +1256,11 @@ int diff_main(int argc, char **argv) {
else {
if (S_ISDIR(stb1.st_mode)) {
argv[0] = concat_path_file(argv[0], argv[1]);
- if (stat(argv[0], &stb1) < 0)
- bb_perror_msg_and_die("Couldn't stat %s", argv[0]);
+ xstat(argv[0], &stb1);
}
if (S_ISDIR(stb2.st_mode)) {
argv[1] = concat_path_file(argv[1], argv[0]);
- if (stat(argv[1], &stb2) < 0)
- bb_perror_msg_and_die("Couldn't stat %s", argv[1]);
+ xstat(argv[1], &stb2);
}
print_status(diffreg(argv[0], argv[1], 0), argv[0], argv[1], NULL);
}
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)
#ifdef CONFIG_SELINUX
security_context_t sid=NULL;
#endif
- int rc;
#ifdef CONFIG_FEATURE_LS_FOLLOWLINKS
if (all_fmt & FOLLOW_LINKS) {
#ifdef CONFIG_SELINUX
- if (is_selinux_enabled()) {
- rc=0; /* Set the number which means success before hand. */
- rc = getfilecon(fullname,&sid);
+ if (is_selinux_enabled()) {
+ getfilecon(fullname,&sid);
}
#endif
- rc = stat(fullname, &dstat);
- if(rc) {
+ if (stat(fullname, &dstat)) {
bb_perror_msg("%s", fullname);
status = EXIT_FAILURE;
return 0;
@@ -229,12 +226,10 @@ static struct dnode *my_stat(char *fullname, char *name)
{
#ifdef CONFIG_SELINUX
if (is_selinux_enabled()) {
- rc=0; /* Set the number which means success before hand. */
- rc = lgetfilecon(fullname,&sid);
+ lgetfilecon(fullname,&sid);
}
#endif
- rc = lstat(fullname, &dstat);
- if(rc) {
+ if (lstat(fullname, &dstat)) {
bb_perror_msg("%s", fullname);
status = EXIT_FAILURE;
return 0;