brctl: eliminate stray data object
brctl: use constant fd to reduce parameter passing runsvdir: do not use data/bss od: reuse bb_argv_dash last: do not go into endless loop on read error mount: make it not fail scripts/find_bad_common_bufsiz check dc: add INIT_G() (no-op for dc, but we want uniform usage of "G trick") function old new delta runsvdir_main 1646 1672 +26 set_pgrp 1 - -1 exitsoon 1 - -1 check 679 678 -1 svnum 4 - -4 svdir 4 - -4 sv 4 - -4 stamplog 4 - -4 rploglen 4 - -4 rplog 4 - -4 mount_main 995 988 -7 static.default_file_list 8 - -8 pfd 8 - -8 logpipe 8 - -8 static.info 20 - -20 brctl_main 767 739 -28 ------------------------------------------------------------------------------ (add/remove: 0/12 grow/shrink: 1/3 up/down: 26/-106) Total: -80 bytes text data bss dec hex filename 793327 662 7412 801401 c3a79 busybox_old 793329 641 7372 801342 c3a3e busybox_unstripped
This commit is contained in:
@ -1177,7 +1177,6 @@ dump_strings(off_t address, off_t end_offset)
|
|||||||
int od_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
int od_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||||
int od_main(int argc, char **argv)
|
int od_main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
static char const *const default_file_list[] = { "-", NULL };
|
|
||||||
static const struct suffix_mult bkm[] = {
|
static const struct suffix_mult bkm[] = {
|
||||||
{ "b", 512 },
|
{ "b", 512 },
|
||||||
{ "k", 1024 },
|
{ "k", 1024 },
|
||||||
@ -1383,7 +1382,7 @@ int od_main(int argc, char **argv)
|
|||||||
/* If no files were listed on the command line,
|
/* If no files were listed on the command line,
|
||||||
set the global pointer FILE_LIST so that it
|
set the global pointer FILE_LIST so that it
|
||||||
references the null-terminated list of one name: "-". */
|
references the null-terminated list of one name: "-". */
|
||||||
file_list = default_file_list;
|
file_list = bb_argv_dash;
|
||||||
if (argc > 0) {
|
if (argc > 0) {
|
||||||
/* Set the global pointer FILE_LIST so that it
|
/* Set the global pointer FILE_LIST so that it
|
||||||
references the first file-argument on the command-line. */
|
references the first file-argument on the command-line. */
|
||||||
|
@ -19,6 +19,8 @@ enum { STACK_SIZE = (COMMON_BUFSIZE - offsetof(struct globals, stack)) / sizeof(
|
|||||||
#define pointer (G.pointer )
|
#define pointer (G.pointer )
|
||||||
#define base (G.base )
|
#define base (G.base )
|
||||||
#define stack (G.stack )
|
#define stack (G.stack )
|
||||||
|
#define INIT_G() do { \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
static void push(double a)
|
static void push(double a)
|
||||||
@ -194,6 +196,8 @@ static char *get_token(char **buffer)
|
|||||||
int dc_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
int dc_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||||
int dc_main(int argc ATTRIBUTE_UNUSED, char **argv)
|
int dc_main(int argc ATTRIBUTE_UNUSED, char **argv)
|
||||||
{
|
{
|
||||||
|
INIT_G();
|
||||||
|
|
||||||
argv++;
|
argv++;
|
||||||
if (!argv[0]) {
|
if (!argv[0]) {
|
||||||
/* take stuff from stdin if no args are given */
|
/* take stuff from stdin if no args are given */
|
||||||
|
@ -39,9 +39,8 @@ int last_main(int argc, char **argv ATTRIBUTE_UNUSED)
|
|||||||
file = xopen(bb_path_wtmp_file, O_RDONLY);
|
file = xopen(bb_path_wtmp_file, O_RDONLY);
|
||||||
|
|
||||||
printf("%-10s %-14s %-18s %-12.12s %s\n", "USER", "TTY", "HOST", "LOGIN", "TIME");
|
printf("%-10s %-14s %-18s %-12.12s %s\n", "USER", "TTY", "HOST", "LOGIN", "TIME");
|
||||||
while ((n = safe_read(file, (void*)&ut, sizeof(struct utmp))) != 0) {
|
while ((n = full_read(file, &ut, sizeof(ut))) > 0) {
|
||||||
|
if (n != sizeof(ut)) {
|
||||||
if (n != sizeof(struct utmp)) {
|
|
||||||
bb_perror_msg_and_die("short read");
|
bb_perror_msg_and_die("short read");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,16 +52,14 @@ int last_main(int argc, char **argv ATTRIBUTE_UNUSED)
|
|||||||
else if (strncmp(ut.ut_user, "runlevel", 7) == 0)
|
else if (strncmp(ut.ut_user, "runlevel", 7) == 0)
|
||||||
ut.ut_type = RUN_LVL;
|
ut.ut_type = RUN_LVL;
|
||||||
} else {
|
} else {
|
||||||
if (!ut.ut_name[0] || strcmp(ut.ut_name, "LOGIN") == 0 ||
|
if (ut.ut_name[0] == '\0' || strcmp(ut.ut_name, "LOGIN") == 0) {
|
||||||
ut.ut_name[0] == 0)
|
|
||||||
{
|
|
||||||
/* Don't bother. This means we can't find how long
|
/* Don't bother. This means we can't find how long
|
||||||
* someone was logged in for. Oh well. */
|
* someone was logged in for. Oh well. */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (ut.ut_type != DEAD_PROCESS &&
|
if (ut.ut_type != DEAD_PROCESS
|
||||||
ut.ut_name[0] && ut.ut_line[0])
|
&& ut.ut_name[0] && ut.ut_line[0]
|
||||||
{
|
) {
|
||||||
ut.ut_type = USER_PROCESS;
|
ut.ut_type = USER_PROCESS;
|
||||||
}
|
}
|
||||||
if (strcmp(ut.ut_name, "date") == 0) {
|
if (strcmp(ut.ut_name, "date") == 0) {
|
||||||
@ -71,7 +68,7 @@ int last_main(int argc, char **argv ATTRIBUTE_UNUSED)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ut.ut_type!=USER_PROCESS) {
|
if (ut.ut_type != USER_PROCESS) {
|
||||||
switch (ut.ut_type) {
|
switch (ut.ut_type) {
|
||||||
case OLD_TIME:
|
case OLD_TIME:
|
||||||
case NEW_TIME:
|
case NEW_TIME:
|
||||||
|
@ -33,13 +33,15 @@
|
|||||||
|
|
||||||
#if ENABLE_FEATURE_BRCTL_FANCY
|
#if ENABLE_FEATURE_BRCTL_FANCY
|
||||||
#include <linux/if_bridge.h>
|
#include <linux/if_bridge.h>
|
||||||
|
|
||||||
/* FIXME: These 4 funcs are not really clean and could be improved */
|
/* FIXME: These 4 funcs are not really clean and could be improved */
|
||||||
static inline ALWAYS_INLINE void strtotimeval(struct timeval *tv,
|
static ALWAYS_INLINE void strtotimeval(struct timeval *tv,
|
||||||
const char *time_str)
|
const char *time_str)
|
||||||
{
|
{
|
||||||
double secs;
|
double secs;
|
||||||
#if BRCTL_USE_INTERNAL
|
#if BRCTL_USE_INTERNAL
|
||||||
if (!(secs = /*bb_*/strtod(time_str, NULL)))
|
secs = /*bb_*/strtod(time_str, NULL);
|
||||||
|
if (!secs)
|
||||||
#else
|
#else
|
||||||
if (sscanf(time_str, "%lf", &secs) != 1)
|
if (sscanf(time_str, "%lf", &secs) != 1)
|
||||||
#endif
|
#endif
|
||||||
@ -48,7 +50,7 @@ static inline ALWAYS_INLINE void strtotimeval(struct timeval *tv,
|
|||||||
tv->tv_usec = 1000000 * (secs - tv->tv_sec);
|
tv->tv_usec = 1000000 * (secs - tv->tv_sec);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline ALWAYS_INLINE unsigned long __tv_to_jiffies(const struct timeval *tv)
|
static ALWAYS_INLINE unsigned long __tv_to_jiffies(const struct timeval *tv)
|
||||||
{
|
{
|
||||||
unsigned long long jif;
|
unsigned long long jif;
|
||||||
|
|
||||||
@ -56,7 +58,7 @@ static inline ALWAYS_INLINE unsigned long __tv_to_jiffies(const struct timeval *
|
|||||||
|
|
||||||
return jif/10000;
|
return jif/10000;
|
||||||
}
|
}
|
||||||
# if 00
|
# if 0
|
||||||
static void __jiffies_to_tv(struct timeval *tv, unsigned long jiffies)
|
static void __jiffies_to_tv(struct timeval *tv, unsigned long jiffies)
|
||||||
{
|
{
|
||||||
unsigned long long tvusec;
|
unsigned long long tvusec;
|
||||||
@ -74,7 +76,7 @@ static unsigned long str_to_jiffies(const char *time_str)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void arm_ioctl(unsigned long *args,
|
static void arm_ioctl(unsigned long *args,
|
||||||
unsigned long arg0, unsigned long arg1, unsigned long arg2)
|
unsigned long arg0, unsigned long arg1, unsigned long arg2)
|
||||||
{
|
{
|
||||||
args[0] = arg0;
|
args[0] = arg0;
|
||||||
args[1] = arg1;
|
args[1] = arg1;
|
||||||
@ -84,10 +86,9 @@ static void arm_ioctl(unsigned long *args,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
int brctl_main(int argc ATTRIBUTE_UNUSED, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
int brctl_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||||
int brctl_main(int argc ATTRIBUTE_UNUSED, char **argv)
|
int brctl_main(int argc ATTRIBUTE_UNUSED, char **argv)
|
||||||
{
|
{
|
||||||
int fd;
|
|
||||||
static const char keywords[] ALIGN1 =
|
static const char keywords[] ALIGN1 =
|
||||||
"addbr\0" "delbr\0" "addif\0" "delif\0"
|
"addbr\0" "delbr\0" "addif\0" "delif\0"
|
||||||
USE_FEATURE_BRCTL_FANCY(
|
USE_FEATURE_BRCTL_FANCY(
|
||||||
@ -96,16 +97,19 @@ int brctl_main(int argc ATTRIBUTE_UNUSED, char **argv)
|
|||||||
"setpathcost\0" "setportprio\0" "setbridgeprio\0"
|
"setpathcost\0" "setportprio\0" "setbridgeprio\0"
|
||||||
)
|
)
|
||||||
USE_FEATURE_BRCTL_SHOW("showmacs\0" "show\0");
|
USE_FEATURE_BRCTL_SHOW("showmacs\0" "show\0");
|
||||||
|
|
||||||
enum { ARG_addbr = 0, ARG_delbr, ARG_addif, ARG_delif
|
enum { ARG_addbr = 0, ARG_delbr, ARG_addif, ARG_delif
|
||||||
USE_FEATURE_BRCTL_FANCY(,
|
USE_FEATURE_BRCTL_FANCY(,
|
||||||
ARG_stp,
|
ARG_stp,
|
||||||
ARG_setageing, ARG_setfd, ARG_sethello, ARG_setmaxage,
|
ARG_setageing, ARG_setfd, ARG_sethello, ARG_setmaxage,
|
||||||
ARG_setpathcost, ARG_setportprio, ARG_setbridgeprio
|
ARG_setpathcost, ARG_setportprio, ARG_setbridgeprio
|
||||||
)
|
)
|
||||||
USE_FEATURE_BRCTL_SHOW(, ARG_showmacs, ARG_show) };
|
USE_FEATURE_BRCTL_SHOW(, ARG_showmacs, ARG_show)
|
||||||
|
};
|
||||||
|
|
||||||
|
int fd;
|
||||||
smallint key;
|
smallint key;
|
||||||
struct ifreq ifr;
|
struct ifreq ifr;
|
||||||
static char info[] = "bridge %s\0 iface %s";
|
|
||||||
char *br, *brif;
|
char *br, *brif;
|
||||||
#if ENABLE_FEATURE_BRCTL_FANCY
|
#if ENABLE_FEATURE_BRCTL_FANCY
|
||||||
unsigned long args[4] = {0, 0, 0, 0};
|
unsigned long args[4] = {0, 0, 0, 0};
|
||||||
@ -125,25 +129,26 @@ int brctl_main(int argc ATTRIBUTE_UNUSED, char **argv)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
fd = xsocket(AF_INET, SOCK_STREAM, 0);
|
fd = xsocket(AF_INET, SOCK_STREAM, 0);
|
||||||
br = *(argv++);
|
br = *argv++;
|
||||||
|
|
||||||
if (key == ARG_addbr || key == ARG_delbr) { /* addbr or delbr */
|
if (key == ARG_addbr || key == ARG_delbr) { /* addbr or delbr */
|
||||||
ioctl_or_perror_and_die(fd,
|
ioctl_or_perror_and_die(fd,
|
||||||
key == ARG_addbr ? SIOCBRADDBR : SIOCBRDELBR,
|
key == ARG_addbr ? SIOCBRADDBR : SIOCBRDELBR,
|
||||||
br, info, br);
|
br, "bridge %s", br);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (!*argv) /* all but 'show' need at least one argument */
|
if (!*argv) /* all but 'show' need at least one argument */
|
||||||
bb_show_usage();
|
bb_show_usage();
|
||||||
safe_strncpy(ifr.ifr_name, br, IFNAMSIZ);
|
safe_strncpy(ifr.ifr_name, br, IFNAMSIZ);
|
||||||
if (key == ARG_addif || key == ARG_delif) { /* addif or delif */
|
if (key == ARG_addif || key == ARG_delif) { /* addif or delif */
|
||||||
brif = *(argv++);
|
brif = *argv++;
|
||||||
if (!(ifr.ifr_ifindex = if_nametoindex(brif))) {
|
ifr.ifr_ifindex = if_nametoindex(brif);
|
||||||
bb_perror_msg_and_die(info+11, brif);
|
if (!ifr.ifr_ifindex) {
|
||||||
|
bb_perror_msg_and_die("iface %s", brif);
|
||||||
}
|
}
|
||||||
ioctl_or_perror_and_die(fd,
|
ioctl_or_perror_and_die(fd,
|
||||||
key == ARG_addif ? SIOCBRADDIF : SIOCBRDELIF,
|
key == ARG_addif ? SIOCBRADDIF : SIOCBRDELIF,
|
||||||
&ifr, info, br);
|
&ifr, "bridge %s", br);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
#if ENABLE_FEATURE_BRCTL_FANCY
|
#if ENABLE_FEATURE_BRCTL_FANCY
|
||||||
@ -156,11 +161,10 @@ int brctl_main(int argc ATTRIBUTE_UNUSED, char **argv)
|
|||||||
}
|
}
|
||||||
if ((unsigned)(key - ARG_stp) < 5) { /* time related ops */
|
if ((unsigned)(key - ARG_stp) < 5) { /* time related ops */
|
||||||
unsigned long op = (key == ARG_setageing) ? BRCTL_SET_AGEING_TIME :
|
unsigned long op = (key == ARG_setageing) ? BRCTL_SET_AGEING_TIME :
|
||||||
(key == ARG_setfd) ? BRCTL_SET_BRIDGE_FORWARD_DELAY:
|
(key == ARG_setfd) ? BRCTL_SET_BRIDGE_FORWARD_DELAY :
|
||||||
(key == ARG_sethello) ? BRCTL_SET_BRIDGE_HELLO_TIME:
|
(key == ARG_sethello) ? BRCTL_SET_BRIDGE_HELLO_TIME :
|
||||||
(key == ARG_setmaxage) ? BRCTL_SET_BRIDGE_MAX_AGE :
|
/*key == ARG_setmaxage*/ BRCTL_SET_BRIDGE_MAX_AGE;
|
||||||
-1/* will never be used */;
|
arm_ioctl(args, op, str_to_jiffies(*argv), 0);
|
||||||
arm_ioctl(args, op, str_to_jiffies (*argv), 0);
|
|
||||||
goto fire;
|
goto fire;
|
||||||
}
|
}
|
||||||
port = -1;
|
port = -1;
|
||||||
@ -168,25 +172,28 @@ int brctl_main(int argc ATTRIBUTE_UNUSED, char **argv)
|
|||||||
int ifidx[MAX_PORTS];
|
int ifidx[MAX_PORTS];
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
|
||||||
if (!(port = if_nametoindex(*argv)))
|
port = if_nametoindex(*argv);
|
||||||
|
if (!port)
|
||||||
bb_error_msg_and_die(bb_msg_invalid_arg, *argv, "port");
|
bb_error_msg_and_die(bb_msg_invalid_arg, *argv, "port");
|
||||||
argv++;
|
argv++;
|
||||||
memset(ifidx, 0, sizeof ifidx);
|
memset(ifidx, 0, sizeof ifidx);
|
||||||
arm_ioctl(args, BRCTL_GET_PORT_LIST, (unsigned long)ifidx,
|
arm_ioctl(args, BRCTL_GET_PORT_LIST, (unsigned long)ifidx,
|
||||||
MAX_PORTS);
|
MAX_PORTS);
|
||||||
xioctl(fd, SIOCDEVPRIVATE, &ifr);
|
xioctl(fd, SIOCDEVPRIVATE, &ifr);
|
||||||
for (i = 0; i < MAX_PORTS; i++)
|
for (i = 0; i < MAX_PORTS; i++) {
|
||||||
if (ifidx[i] == port) {
|
if (ifidx[i] == port) {
|
||||||
port = i;
|
port = i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (key == ARG_setpathcost
|
if (key == ARG_setpathcost
|
||||||
|| key == ARG_setportprio || key == ARG_setbridgeprio) {
|
|| key == ARG_setportprio
|
||||||
|
|| key == ARG_setbridgeprio
|
||||||
|
) {
|
||||||
unsigned long op = (key == ARG_setpathcost) ? BRCTL_SET_PATH_COST :
|
unsigned long op = (key == ARG_setpathcost) ? BRCTL_SET_PATH_COST :
|
||||||
(key == ARG_setportprio) ? BRCTL_SET_PORT_PRIORITY :
|
(key == ARG_setportprio) ? BRCTL_SET_PORT_PRIORITY :
|
||||||
(key == ARG_setbridgeprio) ? BRCTL_SET_BRIDGE_PRIORITY :
|
/*key == ARG_setbridgeprio*/ BRCTL_SET_BRIDGE_PRIORITY;
|
||||||
-1/* will never be used */;
|
|
||||||
unsigned long arg1 = port;
|
unsigned long arg1 = port;
|
||||||
unsigned long arg2;
|
unsigned long arg2;
|
||||||
# if BRCTL_USE_INTERNAL
|
# if BRCTL_USE_INTERNAL
|
||||||
@ -194,7 +201,7 @@ int brctl_main(int argc ATTRIBUTE_UNUSED, char **argv)
|
|||||||
# else
|
# else
|
||||||
if (sscanf(*argv, "%i", &tmp) != 1)
|
if (sscanf(*argv, "%i", &tmp) != 1)
|
||||||
bb_error_msg_and_die(bb_msg_invalid_arg, *argv,
|
bb_error_msg_and_die(bb_msg_invalid_arg, *argv,
|
||||||
key == ARG_setpathcost ? "cost" : "prio");
|
key == ARG_setpathcost ? "cost" : "prio");
|
||||||
# endif
|
# endif
|
||||||
if (key == ARG_setbridgeprio) {
|
if (key == ARG_setbridgeprio) {
|
||||||
arg1 = tmp;
|
arg1 = tmp;
|
||||||
@ -212,6 +219,6 @@ int brctl_main(int argc ATTRIBUTE_UNUSED, char **argv)
|
|||||||
if (ENABLE_FEATURE_CLEAN_UP)
|
if (ENABLE_FEATURE_CLEAN_UP)
|
||||||
close(fd);
|
close(fd);
|
||||||
}
|
}
|
||||||
USE_FEATURE_BRCTL_SHOW(out:)
|
USE_FEATURE_BRCTL_SHOW(out:)
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -42,17 +42,34 @@ struct service {
|
|||||||
smallint isgone;
|
smallint isgone;
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct service *sv;
|
struct globals {
|
||||||
static char *svdir;
|
struct service *sv;
|
||||||
static int svnum;
|
char *svdir;
|
||||||
static char *rplog;
|
char *rplog;
|
||||||
static int rploglen;
|
int svnum;
|
||||||
static struct fd_pair logpipe;
|
int rploglen;
|
||||||
static struct pollfd pfd[1];
|
struct fd_pair logpipe;
|
||||||
static unsigned stamplog;
|
struct pollfd pfd[1];
|
||||||
static smallint check = 1;
|
unsigned stamplog;
|
||||||
static smallint exitsoon;
|
smallint check; /* = 1; */
|
||||||
static smallint set_pgrp;
|
smallint exitsoon;
|
||||||
|
smallint set_pgrp;
|
||||||
|
};
|
||||||
|
#define G (*(struct globals*)&bb_common_bufsiz1)
|
||||||
|
#define sv (G.sv )
|
||||||
|
#define svdir (G.svdir )
|
||||||
|
#define rplog (G.rplog )
|
||||||
|
#define svnum (G.svnum )
|
||||||
|
#define rploglen (G.rploglen )
|
||||||
|
#define logpipe (G.logpipe )
|
||||||
|
#define pfd (G.pfd )
|
||||||
|
#define stamplog (G.stamplog )
|
||||||
|
#define check (G.check )
|
||||||
|
#define exitsoon (G.exitsoon )
|
||||||
|
#define set_pgrp (G.set_pgrp )
|
||||||
|
#define INIT_G() do { \
|
||||||
|
check = 1; \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
static void fatal2_cannot(const char *m1, const char *m2)
|
static void fatal2_cannot(const char *m1, const char *m2)
|
||||||
{
|
{
|
||||||
@ -222,6 +239,8 @@ int runsvdir_main(int argc ATTRIBUTE_UNUSED, char **argv)
|
|||||||
char ch;
|
char ch;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
INIT_G();
|
||||||
|
|
||||||
argv++;
|
argv++;
|
||||||
if (!*argv)
|
if (!*argv)
|
||||||
bb_show_usage();
|
bb_show_usage();
|
||||||
|
@ -214,9 +214,10 @@ struct globals {
|
|||||||
unsigned verbose;
|
unsigned verbose;
|
||||||
#endif
|
#endif
|
||||||
llist_t *fslist;
|
llist_t *fslist;
|
||||||
char getmntent_buf[sizeof(bb_common_bufsiz1) - 8*3];
|
char getmntent_buf[1];
|
||||||
|
|
||||||
};
|
};
|
||||||
|
enum { GETMNTENT_BUFSIZE = COMMON_BUFSIZE - offsetof(struct globals, getmntent_buf) };
|
||||||
#define G (*(struct globals*)&bb_common_bufsiz1)
|
#define G (*(struct globals*)&bb_common_bufsiz1)
|
||||||
#define nfs_mount_version (G.nfs_mount_version)
|
#define nfs_mount_version (G.nfs_mount_version)
|
||||||
#if ENABLE_FEATURE_MOUNT_VERBOSE
|
#if ENABLE_FEATURE_MOUNT_VERBOSE
|
||||||
@ -1775,7 +1776,7 @@ int mount_main(int argc, char **argv)
|
|||||||
if (!mountTable) bb_error_msg_and_die("no %s", bb_path_mtab_file);
|
if (!mountTable) bb_error_msg_and_die("no %s", bb_path_mtab_file);
|
||||||
|
|
||||||
while (getmntent_r(mountTable, &mtpair[0], getmntent_buf,
|
while (getmntent_r(mountTable, &mtpair[0], getmntent_buf,
|
||||||
sizeof(getmntent_buf)))
|
GETMNTENT_BUFSIZE))
|
||||||
{
|
{
|
||||||
// Don't show rootfs. FIXME: why??
|
// Don't show rootfs. FIXME: why??
|
||||||
// util-linux 2.12a happily shows rootfs...
|
// util-linux 2.12a happily shows rootfs...
|
||||||
@ -1842,8 +1843,8 @@ int mount_main(int argc, char **argv)
|
|||||||
// Get next fstab entry
|
// Get next fstab entry
|
||||||
|
|
||||||
if (!getmntent_r(fstab, mtcur, getmntent_buf
|
if (!getmntent_r(fstab, mtcur, getmntent_buf
|
||||||
+ (mtcur==mtpair ? sizeof(getmntent_buf)/2 : 0),
|
+ (mtcur==mtpair ? GETMNTENT_BUFSIZE/2 : 0),
|
||||||
sizeof(getmntent_buf)/2))
|
GETMNTENT_BUFSIZE/2))
|
||||||
{
|
{
|
||||||
// Were we looking for something specific?
|
// Were we looking for something specific?
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user