svn commit: trunk/busybox/coreutils

vda at busybox.net vda at busybox.net
Wed Jun 18 16:38:23 UTC 2008


Author: vda
Date: 2008-06-18 09:38:22 -0700 (Wed, 18 Jun 2008)
New Revision: 22435

Log:
fix trivial error with inverted exit code in ls



Modified:
   trunk/busybox/coreutils/ls.c


Changeset:
Modified: trunk/busybox/coreutils/ls.c
===================================================================
--- trunk/busybox/coreutils/ls.c	2008-06-18 16:30:42 UTC (rev 22434)
+++ trunk/busybox/coreutils/ls.c	2008-06-18 16:38:22 UTC (rev 22435)
@@ -139,7 +139,7 @@
 #if ENABLE_FEATURE_LS_COLOR
 	smallint show_color;
 #endif
-	smallint exit_failure;
+	smallint exit_code;
 	unsigned all_fmt;
 #if ENABLE_FEATURE_AUTOWIDTH
 	unsigned tabstops; // = COLUMN_GAP;
@@ -156,7 +156,7 @@
 #else
 enum { show_color = 0 };
 #endif
-#define exit_failure   (G.exit_failure  )
+#define exit_code      (G.exit_code     )
 #define all_fmt        (G.all_fmt       )
 #if ENABLE_FEATURE_AUTOWIDTH
 #define tabstops       (G.tabstops      )
@@ -206,7 +206,7 @@
 #endif
 		if (stat(fullname, &dstat)) {
 			bb_simple_perror_msg(fullname);
-			exit_failure = 1;
+			exit_code = EXIT_FAILURE;
 			return 0;
 		}
 	} else {
@@ -217,7 +217,7 @@
 #endif
 		if (lstat(fullname, &dstat)) {
 			bb_simple_perror_msg(fullname);
-			exit_failure = 1;
+			exit_code = EXIT_FAILURE;
 			return 0;
 		}
 	}
@@ -529,7 +529,7 @@
 	nfiles = 0;
 	dir = warn_opendir(path);
 	if (dir == NULL) {
-		exit_failure = 1;
+		exit_code = EXIT_FAILURE;
 		return NULL;	/* could not open the dir */
 	}
 	while ((entry = readdir(dir)) != NULL) {
@@ -975,5 +975,5 @@
 	}
 	if (ENABLE_FEATURE_CLEAN_UP)
 		dfree(dnp, nfiles);
-	return (exit_failure == 0);
+	return exit_code;
 }




More information about the busybox-cvs mailing list