Compare commits

...
9 Commits
Author SHA1 Message Date
Denys Vlasenko 757e46252c apply post-1.14.3 fixes; bump version to 1.14.4
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-12 17:49:22 +02:00
Denys Vlasenko f5d4bddfbe trylink: don't use ld --gc-sections if ld doesn't support it
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-08-20 13:57:15 -04:00
Denys Vlasenko 89f022469f revert last commit, it was meant for master
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-08-03 03:01:29 +02:00
Tomoya Adachi 471ca65091 nc: fix nc -ll; report vfork errors; make select loop faster
function                                             old     new   delta
nc_main                                              933     946     +13

Signed-off-by: Tomoya Adachi <adachi@il.is.s.u-tokyo.ac.jp>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-08-03 02:45:24 +02:00
Denys Vlasenko 1e32f91e3b bump version to 1.14.3
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-08-02 20:18:51 +02:00
Denys Vlasenko 4cd4eb4332 apply post-1.14.2 patches
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-08-02 20:18:29 +02:00
Denys Vlasenko 6a98f95373 hush: fix a case when backgrounded cmd makes shell hang
Signed-off-by: Bayram Kurumahmut <kbayram@ubicom.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-22 05:19:15 -04:00
Denys Vlasenko 078d55028e hush: fix bug 353 (wrong handling of \x in assignments)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-22 05:19:08 -04:00
Mike Frysinger bbc31e5f3c depmod.pl: recurse through module dependencies
The previous fix up loaded dependencies two deep, but really that was an
incomplete fix as we need to load dependencies all the way down.  So change
the code to run recursively through all dependencies.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-09 00:30:40 -04:00
23 changed files with 174 additions and 109 deletions

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
VERSION = 1
PATCHLEVEL = 14
SUBLEVEL = 2
SUBLEVEL = 4
EXTRAVERSION =
NAME = Unnamed
+3 -4
View File
@@ -44,7 +44,6 @@ int df_main(int argc, char **argv)
FILE *mount_table;
struct mntent *mount_entry;
struct statfs s;
static const char ignored_mounts[] ALIGN1 = "rootfs\0";
enum {
OPT_KILO = (1 << 0),
@@ -120,7 +119,7 @@ int df_main(int argc, char **argv)
mount_point = *argv++;
if (!mount_point)
break;
mount_entry = find_mount_point(mount_point, bb_path_mtab_file);
mount_entry = find_mount_point(mount_point);
if (!mount_entry) {
bb_error_msg("%s: can't find mount point", mount_point);
set_error:
@@ -154,8 +153,8 @@ int df_main(int argc, char **argv)
) / (blocks_used + s.f_bavail);
}
/* GNU coreutils 6.10 skip certain mounts, try to be compatible. */
if (index_in_strings(device, ignored_mounts) != -1)
/* GNU coreutils 6.10 skips certain mounts, try to be compatible. */
if (strcmp(device, "rootfs") == 0)
continue;
#ifdef WHY_WE_DO_IT_FOR_DEV_ROOT_ONLY
+43 -20
View File
@@ -144,8 +144,7 @@ static const char ls_options[] ALIGN1 =
USE_FEATURE_LS_FOLLOWLINKS("L") /* 1, 24 */
USE_FEATURE_LS_RECURSIVE("R") /* 1, 25 */
USE_FEATURE_HUMAN_READABLE("h") /* 1, 26 */
USE_SELINUX("K") /* 1, 27 */
USE_SELINUX("Z") /* 1, 28 */
USE_SELINUX("KZ") /* 2, 28 */
USE_FEATURE_AUTOWIDTH("T:w:") /* 2, 30 */
;
enum {
@@ -162,6 +161,16 @@ enum {
OPT_Q = (1 << 10),
//OPT_A = (1 << 11),
//OPT_k = (1 << 12),
OPTBIT_color = 13
+ 4 * ENABLE_FEATURE_LS_TIMESTAMPS
+ 4 * ENABLE_FEATURE_LS_SORTFILES
+ 2 * ENABLE_FEATURE_LS_FILETYPES
+ 1 * ENABLE_FEATURE_LS_FOLLOWLINKS
+ 1 * ENABLE_FEATURE_LS_RECURSIVE
+ 1 * ENABLE_FEATURE_HUMAN_READABLE
+ 2 * ENABLE_SELINUX
+ 2 * ENABLE_FEATURE_AUTOWIDTH,
OPT_color = 1 << OPTBIT_color,
};
enum {
@@ -889,16 +898,6 @@ static int list_single(const struct dnode *dn)
}
/* colored LS support by JaWi, janwillem.janssen@lxtreme.nl */
#if ENABLE_FEATURE_LS_COLOR
/* long option entry used only for --color, which has no short option
* equivalent */
static const char ls_color_opt[] ALIGN1 =
"color\0" Optional_argument "\xff" /* no short equivalent */
;
#endif
int ls_main(int argc UNUSED_PARAM, char **argv)
{
struct dnode **dnd;
@@ -911,8 +910,25 @@ int ls_main(int argc UNUSED_PARAM, char **argv)
int dnfiles;
int dndirs;
int i;
#if ENABLE_FEATURE_LS_COLOR
/* colored LS support by JaWi, janwillem.janssen@lxtreme.nl */
/* coreutils 6.10:
* # ls --color=BOGUS
* ls: invalid argument 'BOGUS' for '--color'
* Valid arguments are:
* 'always', 'yes', 'force'
* 'never', 'no', 'none'
* 'auto', 'tty', 'if-tty'
* (and substrings: "--color=alwa" work too)
*/
static const char ls_longopts[] ALIGN1 =
"color\0" Optional_argument "\xff"; /* no short equivalent */
static const char color_str[] ALIGN1 =
"always\0""yes\0""force\0"
"auto\0""tty\0""if-tty\0";
/* need to initialize since --color has _an optional_ argument */
USE_FEATURE_LS_COLOR(const char *color_opt = "always";)
const char *color_opt = color_str; /* "always" */
#endif
INIT_G();
@@ -927,7 +943,7 @@ int ls_main(int argc UNUSED_PARAM, char **argv)
#endif
/* process options */
USE_FEATURE_LS_COLOR(applet_long_options = ls_color_opt;)
USE_FEATURE_LS_COLOR(applet_long_options = ls_longopts;)
#if ENABLE_FEATURE_AUTOWIDTH
opt_complementary = "T+:w+"; /* -T N, -w N */
opt = getopt32(argv, ls_options, &tabstops, &terminal_width
@@ -966,13 +982,20 @@ int ls_main(int argc UNUSED_PARAM, char **argv)
if (!p || (p[0] && strcmp(p, "none") != 0))
show_color = 1;
}
if (opt & (1 << i)) { /* next flag after short options */
if (strcmp("always", color_opt) == 0)
show_color = 1;
else if (strcmp("never", color_opt) == 0)
if (opt & OPT_color) {
if (color_opt[0] == 'n')
show_color = 0;
else if (strcmp("auto", color_opt) == 0 && isatty(STDOUT_FILENO))
show_color = 1;
else switch (index_in_substrings(color_str, color_opt)) {
case 3:
case 4:
case 5:
if (isatty(STDOUT_FILENO)) {
case 0:
case 1:
case 2:
show_color = 1;
}
}
}
#endif
+10 -3
View File
@@ -571,7 +571,14 @@ static number_t nexpr(enum token n)
nest_msg(">nexpr(%s)\n", TOKSTR[n]);
if (n == UNOT) {
res = !nexpr(check_operator(*++args));
n = check_operator(*++args);
if (n == EOI) {
/* special case: [ ! ], [ a -a ! ] are valid */
/* IOW, "! ARG" may miss ARG */
unnest_msg("<nexpr:1 (!EOI)\n");
return 1;
}
res = !nexpr(n);
unnest_msg("<nexpr:%lld\n", res);
return res;
}
@@ -742,7 +749,7 @@ int test_main(int argc, char **argv)
check_operator(argv[1]);
if (last_operator->op_type == BINOP) {
/* "test [!] arg1 <binary_op> arg2" */
args = &argv[0];
args = argv;
res = (binop() == 0);
goto ret;
}
@@ -755,7 +762,7 @@ int test_main(int argc, char **argv)
argv--;
}
#endif
args = &argv[0];
args = argv;
res = !oexpr(check_operator(*args));
if (*args != NULL && *++args != NULL) {
+21 -10
View File
@@ -167,21 +167,32 @@ sub maybe_unshift
}
unshift (@{$array}, $ele);
}
sub add_mod_deps
{
my ($depth, $mod, $mod2, $module, $this_module) = @_;
$depth .= " ";
warn "${depth}loading deps of module: $this_module\n" if $verbose;
foreach my $md (keys %{$mod->{$this_module}}) {
add_mod_deps ($depth, $mod, $mod2, $module, $md);
warn "${depth} outputting $md\n" if $verbose;
maybe_unshift (\@{$$mod2->{$module}}, $md);
}
if (!%{$mod->{$this_module}}) {
warn "${depth} no deps\n" if $verbose;
}
}
foreach my $module (keys %$mod) {
warn "filling out module: $module\n" if $verbose;
@{$mod2->{$module}} = ();
foreach my $md (keys %{$mod->{$module}}) {
foreach my $md2 (keys %{$mod->{$md}}) {
warn "outputting $md2\n" if $verbose;
maybe_unshift (\@{$mod2->{$module}}, $md2);
}
warn "outputting $md\n" if $verbose;
maybe_unshift (\@{$mod2->{$module}}, $md);
}
warn "filling out module: $module\n" if $verbose;
@{$mod2->{$module}} = ();
add_mod_deps ("", $mod, \$mod2, $module, $module);
}
# figure out where the output should go
if ($stdout == 0) {
warn "writing $basedir/modules.dep\n" if $verbose;
open(STDOUT, ">$basedir/modules.dep")
or die "cannot open $basedir/modules.dep: $!";
}
+1 -1
View File
@@ -284,7 +284,7 @@ USE_PATCH(APPLET(patch, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_PGREP(APPLET(pgrep, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_PIDOF(APPLET(pidof, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_PING(APPLET(ping, _BB_DIR_BIN, _BB_SUID_MAYBE))
USE_PING6(APPLET(ping6, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_PING6(APPLET(ping6, _BB_DIR_BIN, _BB_SUID_MAYBE))
USE_PIPE_PROGRESS(APPLET(pipe_progress, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_PIVOT_ROOT(APPLET(pivot_root, _BB_DIR_SBIN, _BB_SUID_NEVER))
USE_PKILL(APPLET_ODDNAME(pkill, pgrep, _BB_DIR_USR_BIN, _BB_SUID_NEVER, pkill))
+1 -1
View File
@@ -1025,7 +1025,7 @@ extern void run_applet_no_and_exit(int a, char **argv) NORETURN FAST_FUNC;
#ifdef HAVE_MNTENT_H
extern int match_fstype(const struct mntent *mt, const char *fstypes) FAST_FUNC;
extern struct mntent *find_mount_point(const char *name, const char *table) FAST_FUNC;
extern struct mntent *find_mount_point(const char *name) FAST_FUNC;
#endif
extern void erase_mtab(const char * name) FAST_FUNC;
extern unsigned int tty_baud_to_value(speed_t speed) FAST_FUNC;
+15 -7
View File
@@ -17,7 +17,7 @@
* Given any other file (or directory), find the mount table entry for its
* filesystem.
*/
struct mntent* FAST_FUNC find_mount_point(const char *name, const char *table)
struct mntent* FAST_FUNC find_mount_point(const char *name)
{
struct stat s;
dev_t mountDevice;
@@ -25,27 +25,35 @@ struct mntent* FAST_FUNC find_mount_point(const char *name, const char *table)
struct mntent *mountEntry;
if (stat(name, &s) != 0)
return 0;
return NULL;
if ((s.st_mode & S_IFMT) == S_IFBLK)
if (S_ISBLK(s.st_mode))
mountDevice = s.st_rdev;
else
mountDevice = s.st_dev;
mountTable = setmntent(table ? table : bb_path_mtab_file, "r");
mountTable = setmntent(bb_path_mtab_file, "r");
if (!mountTable)
return 0;
while ((mountEntry = getmntent(mountTable)) != 0) {
while ((mountEntry = getmntent(mountTable)) != NULL) {
/* rootfs mount in Linux 2.6 exists always,
* and it makes sense to always ignore it.
* Otherwise people can't reference their "real" root! */
if (strcmp(mountEntry->mnt_fsname, "rootfs") == 0)
continue;
if (strcmp(name, mountEntry->mnt_dir) == 0
|| strcmp(name, mountEntry->mnt_fsname) == 0
) { /* String match. */
break;
}
if (stat(mountEntry->mnt_fsname, &s) == 0 && s.st_rdev == mountDevice) /* Match the device. */
/* Match the device. */
if (stat(mountEntry->mnt_fsname, &s) == 0 && s.st_rdev == mountDevice)
break;
if (stat(mountEntry->mnt_dir, &s) == 0 && s.st_dev == mountDevice) /* Match the directory's mount point. */
/* Match the directory's mount point. */
if (stat(mountEntry->mnt_dir, &s) == 0 && s.st_dev == mountDevice)
break;
}
endmntent(mountTable);
+1
View File
@@ -218,6 +218,7 @@ static void parse_module(module_info *info, const char *pathname)
bksp(); /* remove last ' ' */
appendc('\0');
info->aliases = copy_stringbuf();
replace(info->aliases, '-', '_');
/* "dependency1 depandency2" */
reset_stringbuf();
+13 -19
View File
@@ -2101,8 +2101,12 @@ static void handle_incoming_and_exit(const len_and_sockaddr *fromAddr)
}
send_cgi_and_exit(urlcopy, prequest, length, cookie, content_type);
}
#endif
if (urlp[-1] == '/')
strcpy(urlp, index_page);
if (stat(tptr, &sb) == 0) {
#if ENABLE_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR
{
char *suffix = strrchr(tptr, '.');
if (suffix) {
Htaccess *cur;
@@ -2112,16 +2116,7 @@ static void handle_incoming_and_exit(const len_and_sockaddr *fromAddr)
}
}
}
}
#endif
if (prequest != request_GET && prequest != request_HEAD) {
send_headers_and_exit(HTTP_NOT_IMPLEMENTED);
}
#endif /* FEATURE_HTTPD_CGI */
if (urlp[-1] == '/')
strcpy(urlp, index_page);
if (stat(tptr, &sb) == 0) {
file_size = sb.st_size;
last_mod = sb.st_mtime;
}
@@ -2135,19 +2130,18 @@ static void handle_incoming_and_exit(const len_and_sockaddr *fromAddr)
send_cgi_and_exit("/cgi-bin/index.cgi", prequest, length, cookie, content_type);
}
}
#endif
/* else {
* fall through to send_file, it errors out if open fails
* }
*/
/* else fall through to send_file, it errors out if open fails: */
if (prequest != request_GET && prequest != request_HEAD) {
/* POST for files does not make sense */
send_headers_and_exit(HTTP_NOT_IMPLEMENTED);
}
send_file_and_exit(tptr,
#if ENABLE_FEATURE_HTTPD_CGI
(prequest != request_HEAD ? SEND_HEADERS_AND_BODY : SEND_HEADERS)
#else
SEND_HEADERS_AND_BODY
#endif
);
#else
send_file_and_exit(tptr, SEND_HEADERS_AND_BODY);
#endif
}
/*
+1 -1
View File
@@ -420,7 +420,7 @@ void FAST_FUNC read_leases(const char *file)
continue;
/* NB: add_lease takes "relative time", IOW,
* lease duration, not lease deadline. */
if (!(add_lease(lease.chaddr, lease.yiaddr, expires, lease.hostname))) {
if (!(add_lease(lease.chaddr, lease.yiaddr, expires, NULL /* was lease.hostname. bug in add_lease, disabled */ ))) {
bb_error_msg("too many leases while loading %s", file);
break;
}
+5
View File
@@ -99,6 +99,11 @@ else
fi
)`
# The --gc-sections option is not supported by older versions of ld
if test -n "$GC_SECTIONS"; then
GC_SECTIONS=`check_cc "$GC_SECTIONS" ""`
fi
# Sanitize lib list (dups, extra spaces etc)
LDLIBS=`echo "$LDLIBS" | xargs -n1 | sort | uniq | xargs`
+1 -1
View File
@@ -5786,7 +5786,7 @@ argstr(char *p, int flag, struct strlist *var_str_list)
};
const char *reject = spclchars;
int c;
int quotes = flag & (EXP_FULL | EXP_CASE); /* do CTLESC */
int quotes = flag & (EXP_FULL | EXP_CASE | EXP_REDIR); /* do CTLESC */
int breakall = flag & EXP_WORD;
int inquotes;
size_t length;
+17 -22
View File
@@ -2053,10 +2053,10 @@ static char *expand_pseudo_dquoted(const char *str)
* 'echo -$*-'. If you play here, you must run testsuite afterwards! */
static int expand_vars_to_list(o_string *output, int n, char *arg, char or_mask)
{
/* or_mask is either 0 (normal case) or 0x80
* (expansion of right-hand side of assignment == 1-element expand.
* It will also do no globbing, and thus we must not backslash-quote!) */
/* or_mask is either 0 (normal case) or 0x80 -
* expansion of right-hand side of assignment == 1-element expand.
* It will also do no globbing, and thus we must not backslash-quote!
*/
char ored_ch;
char *p;
@@ -2410,6 +2410,7 @@ static char *expand_string_to_string(const char *str)
bb_error_msg_and_die("BUG in varexp2");
/* actually, just move string 2*sizeof(char*) bytes back */
overlapping_strcpy((char*)list, list[0]);
unbackslash((char*)list);
debug_printf_expand("string_to_string='%s'\n", (char*)list);
return (char*)list;
}
@@ -3397,6 +3398,8 @@ static int checkjobs(struct pipe* fg_pipe)
#endif
return rcode;
}
if (!fg_pipe->alive_cmds)
return rcode;
}
/* There are still running processes in the fg pipe */
goto wait_more; /* do waitpid again */
@@ -3871,7 +3874,6 @@ static int run_list(struct pipe *pi)
#endif
#if ENABLE_HUSH_LOOPS
struct pipe *loop_top = NULL;
char *for_varname = NULL;
char **for_lcur = NULL;
char **for_list = NULL;
#endif
@@ -4007,22 +4009,18 @@ static int run_list(struct pipe *pi)
for_list = expand_strvec_to_strvec(vals);
for_lcur = for_list;
debug_print_strings("for_list", for_list);
for_varname = pi->cmds[0].argv[0];
pi->cmds[0].argv[0] = NULL;
}
free(pi->cmds[0].argv[0]);
if (!*for_lcur) {
/* "for" loop is over, clean up */
free(for_list);
for_list = NULL;
for_lcur = NULL;
pi->cmds[0].argv[0] = for_varname;
break;
}
/* Insert next value from for_lcur */
/* note: *for_lcur already has quotes removed, $var expanded, etc */
pi->cmds[0].argv[0] = xasprintf("%s=%s", for_varname, *for_lcur++);
pi->cmds[0].assignment_cnt = 1;
set_local_var(xasprintf("%s=%s", pi->cmds[0].argv[0], *for_lcur++), 0, 0);
continue;
}
if (rword == RES_IN) {
continue; /* "for v IN list;..." - "in" has no cmds anyway */
@@ -4509,12 +4507,12 @@ static int done_word(o_string *word, struct parse_context *ctx)
* Same with heredocs:
* for <<\H delim is H; <<\\H, <<"\H", <<"\\H" - \H
*/
unbackslash(ctx->pending_redirect->rd_filename);
/* Is it <<"HEREDOC"? */
if (ctx->pending_redirect->rd_type == REDIRECT_HEREDOC
&& word->o_quoted
) {
ctx->pending_redirect->rd_dup |= HEREDOC_QUOTED;
if (ctx->pending_redirect->rd_type == REDIRECT_HEREDOC) {
unbackslash(ctx->pending_redirect->rd_filename);
/* Is it <<"HEREDOC"? */
if (word->o_quoted) {
ctx->pending_redirect->rd_dup |= HEREDOC_QUOTED;
}
}
debug_printf_parse("word stored in rd_filename: '%s'\n", word->data);
ctx->pending_redirect = NULL;
@@ -5433,7 +5431,7 @@ static int parse_stream_dquoted(o_string *as_string,
* "The backslash retains its special meaning [in "..."]
* only when followed by one of the following characters:
* $, `, ", \, or <newline>. A double quote may be quoted
* within double quotes by preceding it with a backslash.
* within double quotes by preceding it with a backslash."
*/
if (strchr("$`\"\\\n", next) != NULL) {
ch = i_getch(input);
@@ -5802,10 +5800,7 @@ static struct pipe *parse_stream(char **pstring,
nommu_addchr(&ctx.as_string, ch);
if (ch == '\'')
break;
if (dest.o_assignment == NOT_ASSIGNMENT)
o_addqchr(&dest, ch);
else
o_addchr(&dest, ch);
o_addqchr(&dest, ch);
}
break;
case '"':
@@ -0,0 +1,9 @@
a\nb\nc\n
a
b
c
a\nb\nc\n
a
b
c
Done
+7
View File
@@ -0,0 +1,7 @@
v="a\nb\nc\n"
echo "$v"
printf "$v"
v='a\nb\nc\n'
echo "$v"
printf "$v"
echo Done
+3 -3
View File
@@ -1,4 +1,4 @@
[ -n "$d" ] || d=..
ls -1 "$d" > logfile.gnu
busybox ls -1 "$d" > logfile.bb
cmp logfile.gnu logfile.bb
LC_ALL=C ls -1 "$d" > logfile.gnu
LC_ALL=C busybox ls -1 "$d" > logfile.bb
diff -ubw logfile.gnu logfile.bb
+3 -3
View File
@@ -1,4 +1,4 @@
[ -n "$d" ] || d=..
ls -h "$d" > logfile.gnu
busybox ls -h "$d" > logfile.bb
cmp logfile.gnu logfile.bb
LC_ALL=C ls -h "$d" > logfile.gnu
LC_ALL=C busybox ls -h "$d" > logfile.bb
diff -ubw logfile.gnu logfile.bb
+2 -2
View File
@@ -1,4 +1,4 @@
[ -n "$d" ] || d=..
LC_ALL=C ls -l "$d" > logfile.gnu
busybox ls -l "$d" > logfile.bb
diff -w logfile.gnu logfile.bb
LC_ALL=C busybox ls -l "$d" > logfile.bb
diff -ubw logfile.gnu logfile.bb
+2 -2
View File
@@ -1,4 +1,4 @@
[ -n "$d" ] || d=..
LC_ALL=C ls -1s "$d" > logfile.gnu
busybox ls -1s "$d" > logfile.bb
cmp logfile.gnu logfile.bb
LC_ALL=C busybox ls -1s "$d" > logfile.bb
diff -ubw logfile.gnu logfile.bb
+10
View File
@@ -21,6 +21,11 @@ testing "test '': should be false (1)" \
"1\n" \
"" ""
testing "test !: should be true (0)" \
"busybox test !; echo \$?" \
"0\n" \
"" ""
testing "test a: should be true (0)" \
"busybox test a; echo \$?" \
"0\n" \
@@ -51,6 +56,11 @@ testing "test -lt = -gt: should be false (1)" \
"1\n" \
"" ""
testing "test a -a !: should be true (0)" \
"busybox test a -a !; echo \$?" \
"0\n" \
"" ""
testing "test -f = a -o b: should be true (0)" \
"busybox test -f = a -o b; echo \$?" \
"0\n" \
+2 -6
View File
@@ -624,7 +624,6 @@ static void setup_tables(void)
int mkfs_minix_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int mkfs_minix_main(int argc UNUSED_PARAM, char **argv)
{
struct mntent *mp;
unsigned opt;
char *tmp;
struct stat statbuf;
@@ -683,11 +682,8 @@ int mkfs_minix_main(int argc UNUSED_PARAM, char **argv)
G.total_blocks = 65535;
/* Check if it is mounted */
mp = find_mount_point(G.device_name, NULL);
if (mp && strcmp(G.device_name, mp->mnt_fsname) == 0)
bb_error_msg_and_die("%s is mounted on %s; "
"refusing to make a filesystem",
G.device_name, mp->mnt_dir);
if (find_mount_point(G.device_name))
bb_error_msg_and_die("can't format mounted filesystem");
xmove_fd(xopen(G.device_name, O_RDWR), dev_fd);
if (fstat(dev_fd, &statbuf) < 0)
+3 -3
View File
@@ -273,10 +273,10 @@ int mkfs_vfat_main(int argc UNUSED_PARAM, char **argv)
device_num == 0x0d00 || // xd
device_num == 0x1600 ) // hdc, hdd
)
bb_error_msg_and_die("Will not try to make filesystem on full-disk device (use -I if wanted)");
bb_error_msg_and_die("will not try to make filesystem on full-disk device (use -I if wanted)");
// can't work on mounted filesystems
if (find_mount_point(device_name, NULL))
bb_error_msg_and_die("Can't format mounted filesystem");
if (find_mount_point(device_name))
bb_error_msg_and_die("can't format mounted filesystem");
#endif
// get true sector size
// (parameter must be int*, not long* or size_t*)