svn commit: trunk/busybox: libbb util-linux

vda at busybox.net vda at busybox.net
Fri Sep 7 19:33:56 UTC 2007


Author: vda
Date: 2007-09-07 12:33:56 -0700 (Fri, 07 Sep 2007)
New Revision: 19800

Log:
messages: by popular request allow PATH to be customized at build time
mount: smallish code shrink



Modified:
   trunk/busybox/libbb/messages.c
   trunk/busybox/util-linux/mount.c


Changeset:
Modified: trunk/busybox/libbb/messages.c
===================================================================
--- trunk/busybox/libbb/messages.c	2007-09-07 13:53:32 UTC (rev 19799)
+++ trunk/busybox/libbb/messages.c	2007-09-07 19:33:56 UTC (rev 19800)
@@ -7,13 +7,21 @@
 
 #include "libbb.h"
 
+/* allow default system PATH to be extended via CFLAGS */
+#ifndef BB_ADDITIONAL_PATH
+#define BB_ADDITIONAL_PATH ""
+#endif
+
+/* allow version to be extended, via CFLAGS */
 #ifndef BB_EXTRA_VERSION
-#define BANNER "BusyBox v" BB_VER " (" BB_BT ")"
-#else
+#define BB_EXTRA_VERSION BB_BT
+#endif
+
 #define BANNER "BusyBox v" BB_VER " (" BB_EXTRA_VERSION ")"
-#endif
+
 const char bb_banner[] ALIGN1 = BANNER;
 
+
 const char bb_msg_memory_exhausted[] ALIGN1 = "memory exhausted";
 const char bb_msg_invalid_date[] ALIGN1 = "invalid date '%s'";
 const char bb_msg_write_error[] ALIGN1 = "write error";
@@ -39,7 +47,8 @@
 const char bb_default_login_shell[] ALIGN1 = LIBBB_DEFAULT_LOGIN_SHELL;
 /* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin,
  * but I want to save a few bytes here. Check libbb.h before changing! */
-const char bb_PATH_root_path[] ALIGN1 = "PATH=/sbin:/usr/sbin:/bin:/usr/bin";
+const char bb_PATH_root_path[] ALIGN1 = 
+	"PATH=/sbin:/usr/sbin:/bin:/usr/bin" BB_ADDITIONAL_PATH;
 
 
 const int const_int_0;
@@ -49,11 +58,11 @@
 /* This is usually something like "/var/adm/wtmp" or "/var/log/wtmp" */
 const char bb_path_wtmp_file[] ALIGN1 =
 #if defined _PATH_WTMP
-_PATH_WTMP;
+	_PATH_WTMP;
 #elif defined WTMP_FILE
-WTMP_FILE;
+	WTMP_FILE;
 #else
-# error unknown path to wtmp file
+#error unknown path to wtmp file
 #endif
 
 char bb_common_bufsiz1[COMMON_BUFSIZE];

Modified: trunk/busybox/util-linux/mount.c
===================================================================
--- trunk/busybox/util-linux/mount.c	2007-09-07 13:53:32 UTC (rev 19799)
+++ trunk/busybox/util-linux/mount.c	2007-09-07 19:33:56 UTC (rev 19800)
@@ -1527,11 +1527,10 @@
 	if (ENABLE_FEATURE_CLEAN_UP)
 		free(filteropts);
 
-	if (rc && errno == EBUSY && ignore_busy)
-		rc = 0;
+	if (errno == EBUSY && ignore_busy)
+		return 0;
 	if (rc < 0)
 		bb_perror_msg("mounting %s on %s failed", mp->mnt_fsname, mp->mnt_dir);
-
 	return rc;
 }
 




More information about the busybox-cvs mailing list