messages: by popular request allow PATH to be customized at build time mount: smallish code shrink
No binary (build failed)
—
(log yok)
| @@ -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 BANNER "BusyBox v" BB_VER " (" BB_EXTRA_VERSION ")" |
| + | #define BB_EXTRA_VERSION BB_BT |
| #endif | |
| + | |
| + | #define BANNER "BusyBox v" BB_VER " (" BB_EXTRA_VERSION ")" |
| + | |
| 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_busybox_exec_path[] ALIGN1 = CONFIG_BUSYBOX_EXEC_PATH; | |
| 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 @@ const int const_int_1 = 1; | |
| /* 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]; | |
| @@ -1527,11 +1527,10 @@ static int singlemount(struct mntent *mp, int ignore_busy) | |
| 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; | |
| } | |