aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-06-18 16:38:22 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-06-18 16:38:22 +0000
commit4a689e9b49a0a40c062c5e4b1d46a100ec7f6d85 (patch)
treeafd0593835a49b36410d911719b15a48cc10e48b
parent55789c6646d1134c6e75380e66a953b676acfde9 (diff)
downloadbusybox-w32-4a689e9b49a0a40c062c5e4b1d46a100ec7f6d85.tar.gz
busybox-w32-4a689e9b49a0a40c062c5e4b1d46a100ec7f6d85.tar.bz2
busybox-w32-4a689e9b49a0a40c062c5e4b1d46a100ec7f6d85.zip
fix trivial error with inverted exit code in ls
-rw-r--r--coreutils/ls.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/coreutils/ls.c b/coreutils/ls.c
index 7d33eae8d..56be12a64 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -139,7 +139,7 @@ struct globals {
139#if ENABLE_FEATURE_LS_COLOR 139#if ENABLE_FEATURE_LS_COLOR
140 smallint show_color; 140 smallint show_color;
141#endif 141#endif
142 smallint exit_failure; 142 smallint exit_code;
143 unsigned all_fmt; 143 unsigned all_fmt;
144#if ENABLE_FEATURE_AUTOWIDTH 144#if ENABLE_FEATURE_AUTOWIDTH
145 unsigned tabstops; // = COLUMN_GAP; 145 unsigned tabstops; // = COLUMN_GAP;
@@ -156,7 +156,7 @@ struct globals {
156#else 156#else
157enum { show_color = 0 }; 157enum { show_color = 0 };
158#endif 158#endif
159#define exit_failure (G.exit_failure ) 159#define exit_code (G.exit_code )
160#define all_fmt (G.all_fmt ) 160#define all_fmt (G.all_fmt )
161#if ENABLE_FEATURE_AUTOWIDTH 161#if ENABLE_FEATURE_AUTOWIDTH
162#define tabstops (G.tabstops ) 162#define tabstops (G.tabstops )
@@ -206,7 +206,7 @@ static struct dnode *my_stat(const char *fullname, const char *name, int force_f
206#endif 206#endif
207 if (stat(fullname, &dstat)) { 207 if (stat(fullname, &dstat)) {
208 bb_simple_perror_msg(fullname); 208 bb_simple_perror_msg(fullname);
209 exit_failure = 1; 209 exit_code = EXIT_FAILURE;
210 return 0; 210 return 0;
211 } 211 }
212 } else { 212 } else {
@@ -217,7 +217,7 @@ static struct dnode *my_stat(const char *fullname, const char *name, int force_f
217#endif 217#endif
218 if (lstat(fullname, &dstat)) { 218 if (lstat(fullname, &dstat)) {
219 bb_simple_perror_msg(fullname); 219 bb_simple_perror_msg(fullname);
220 exit_failure = 1; 220 exit_code = EXIT_FAILURE;
221 return 0; 221 return 0;
222 } 222 }
223 } 223 }
@@ -529,7 +529,7 @@ static struct dnode **list_dir(const char *path)
529 nfiles = 0; 529 nfiles = 0;
530 dir = warn_opendir(path); 530 dir = warn_opendir(path);
531 if (dir == NULL) { 531 if (dir == NULL) {
532 exit_failure = 1; 532 exit_code = EXIT_FAILURE;
533 return NULL; /* could not open the dir */ 533 return NULL; /* could not open the dir */
534 } 534 }
535 while ((entry = readdir(dir)) != NULL) { 535 while ((entry = readdir(dir)) != NULL) {
@@ -975,5 +975,5 @@ int ls_main(int argc ATTRIBUTE_UNUSED, char **argv)
975 } 975 }
976 if (ENABLE_FEATURE_CLEAN_UP) 976 if (ENABLE_FEATURE_CLEAN_UP)
977 dfree(dnp, nfiles); 977 dfree(dnp, nfiles);
978 return (exit_failure == 0); 978 return exit_code;
979} 979}