Bug fixes.
-Erik
This commit is contained in:
parent
9a9a261569
commit
05df239ed9
@ -1,12 +1,17 @@
|
||||
0.41
|
||||
* New App: wc -- contributed by Edward Betts <edward@debian.org>
|
||||
* Fixed a bug in both cp and mv preventing 'cp foo/README bar'
|
||||
type commands (file in a directory to another directory)
|
||||
from working.
|
||||
* Fixed a logger bug that caused garbage to be written to the syslog
|
||||
(unless you used busybox syslog, which hid the bug). Thanks
|
||||
to Alex Holden <alex@linuxhacker.org> for the fix.
|
||||
* /bin/true and /bin/false were echoing a blank line when run. Now fixed.
|
||||
* mkdir -p would print an error when asked to mkdir an existing dir
|
||||
with no interveining subdirectories.
|
||||
* Fixed "syslogd -O" so that it works.
|
||||
|
||||
-Erik Andersen,
|
||||
-Erik Andersen
|
||||
|
||||
0.40
|
||||
* New Apps: sort, uniq. -beppu
|
||||
|
2
Makefile
2
Makefile
@ -17,7 +17,7 @@
|
||||
|
||||
|
||||
PROG=busybox
|
||||
VERSION=0.40
|
||||
VERSION=0.41
|
||||
BUILDTIME=$(shell date "+%Y%m%d-%H%M")
|
||||
|
||||
# Comment out the following to make a debuggable build
|
||||
|
1
TODO
1
TODO
@ -18,7 +18,6 @@ around to it some time. If you have any good ideas, please let me know.
|
||||
* hwclock
|
||||
* killall
|
||||
* stty
|
||||
* wc
|
||||
* tr
|
||||
* expr (maybe?) (ash builtin?)
|
||||
|
||||
|
@ -5,6 +5,16 @@
|
||||
|
||||
static int been_there_done_that = 0;
|
||||
|
||||
#if 0
|
||||
void exit (int status) __attribute__ ((noreturn));
|
||||
void exit (int status) { _exit(status); };
|
||||
void abort (void) __attribute__ ((__noreturn__));
|
||||
void abort (void) { _exit(0); };
|
||||
int atexit (void (*__func) (void)) { _exit(0); };
|
||||
void *__libc_stack_end;
|
||||
#endif
|
||||
|
||||
|
||||
static const struct Applet applets[] = {
|
||||
|
||||
#ifdef BB_BUSYBOX //bin
|
||||
@ -219,6 +229,9 @@ static const struct Applet applets[] = {
|
||||
{"true", true_main},
|
||||
{"false", false_main},
|
||||
#endif
|
||||
#ifdef BB_WC //usr/bin
|
||||
{"wc", wc_main},
|
||||
#endif
|
||||
#ifdef BB_UNAME //bin
|
||||
{"uname", uname_main},
|
||||
#endif
|
||||
@ -241,6 +254,8 @@ static const struct Applet applets[] = {
|
||||
{0}
|
||||
};
|
||||
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
char *s = argv[0];
|
||||
|
15
busybox.c
15
busybox.c
@ -5,6 +5,16 @@
|
||||
|
||||
static int been_there_done_that = 0;
|
||||
|
||||
#if 0
|
||||
void exit (int status) __attribute__ ((noreturn));
|
||||
void exit (int status) { _exit(status); };
|
||||
void abort (void) __attribute__ ((__noreturn__));
|
||||
void abort (void) { _exit(0); };
|
||||
int atexit (void (*__func) (void)) { _exit(0); };
|
||||
void *__libc_stack_end;
|
||||
#endif
|
||||
|
||||
|
||||
static const struct Applet applets[] = {
|
||||
|
||||
#ifdef BB_BUSYBOX //bin
|
||||
@ -219,6 +229,9 @@ static const struct Applet applets[] = {
|
||||
{"true", true_main},
|
||||
{"false", false_main},
|
||||
#endif
|
||||
#ifdef BB_WC //usr/bin
|
||||
{"wc", wc_main},
|
||||
#endif
|
||||
#ifdef BB_UNAME //bin
|
||||
{"uname", uname_main},
|
||||
#endif
|
||||
@ -241,6 +254,8 @@ static const struct Applet applets[] = {
|
||||
{0}
|
||||
};
|
||||
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
char *s = argv[0];
|
||||
|
@ -72,12 +72,13 @@
|
||||
#define BB_SORT
|
||||
#define BB_SWAPONOFF
|
||||
#define BB_SYNC
|
||||
//#define BB_SYSLOGD
|
||||
#define BB_SYSLOGD
|
||||
#define BB_TAIL
|
||||
#define BB_TAR
|
||||
#define BB_TEE
|
||||
#define BB_TOUCH
|
||||
#define BB_TRUE_FALSE
|
||||
#define BB_WC
|
||||
#define BB_UMOUNT
|
||||
#define BB_UNIQ
|
||||
#define BB_UPDATE
|
||||
|
@ -1,5 +1,5 @@
|
||||
Name: busybox
|
||||
Version: 0.40
|
||||
Version: 0.41
|
||||
Release: 1
|
||||
Group: System/Utilities
|
||||
Summary: BusyBox is a tiny suite of Unix utilities in a multi-call binary.
|
||||
@ -21,7 +21,7 @@ embedded system.
|
||||
%setup -q -n %{Name}-%{Version}
|
||||
|
||||
%Build
|
||||
BB_INIT_SCRIPT='\"/etc/rc.d/init.d/rcS\"' make
|
||||
make
|
||||
|
||||
%Install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
@ -84,7 +84,7 @@ extern int mkdir_main(int argc, char **argv)
|
||||
|
||||
strcpy (buf, *argv);
|
||||
status=stat(buf, &statBuf);
|
||||
if (status != -1 && status != ENOENT ) {
|
||||
if (parentFlag == FALSE && status != -1 && status != ENOENT ) {
|
||||
fprintf(stderr, "%s: File exists\n", buf);
|
||||
exit( FALSE);
|
||||
}
|
||||
@ -93,7 +93,7 @@ extern int mkdir_main(int argc, char **argv)
|
||||
createPath(buf, mode);
|
||||
}
|
||||
else {
|
||||
if (mkdir (buf, mode) != 0) {
|
||||
if (mkdir (buf, mode) != 0 && parentFlag == FALSE) {
|
||||
perror(buf);
|
||||
exit( FALSE);
|
||||
}
|
||||
|
126
docs/CommandList
126
docs/CommandList
@ -12,6 +12,9 @@ ________________________________________________________________________________
|
||||
BusyBox 0.38, Functions and the Arguments they Support
|
||||
|
||||
|
||||
New Apps that have been added to BusyBox since this document was written:
|
||||
ping, hostname, mkfifo, free, tail, du, tee, head, sort, uniq, lsmod, rmmod, fbset, and loadacm.
|
||||
|
||||
|
||||
|
||||
______________________________________________________________________________________________________
|
||||
@ -154,7 +157,7 @@ cp [option] fileA fileB
|
||||
|
||||
attributes group permissions and time information.
|
||||
|
||||
-R recursive Copy to the current location and all subdirectories in the tree.
|
||||
-R recursive Copies directories recursively
|
||||
|
||||
|
||||
|
||||
@ -321,7 +324,7 @@ fsck.minix [-larvsmf] /dev/name
|
||||
|
||||
-r Perform interactive repairs.
|
||||
|
||||
-q Perform automatic repairs
|
||||
-a Perform automatic repairs
|
||||
|
||||
-v Verbose
|
||||
|
||||
@ -712,76 +715,32 @@ ________________________________________________________________________________
|
||||
|
||||
|
||||
|
||||
|
||||
sed
|
||||
Usage: sed [-n] -e script [file...]
|
||||
|
||||
Sed scripts are subject to the following format: 's/regexp/replacement/[gp]' which attempts to
|
||||
Allowed sed scripts come in the following form:
|
||||
'ADDR [!] COMMAND'
|
||||
|
||||
to match regexp against the pattern space and if successful, replaces the matched portion with
|
||||
where address ADDR can be:
|
||||
NUMBER Match specified line number
|
||||
$ Match last line
|
||||
/REGEXP/ Match specified regexp
|
||||
(! inverts the meaning of the match)
|
||||
|
||||
replacement -r or -R Remove contents of directories recursively.
|
||||
and COMMAND can be:
|
||||
s/regexp/replacement/[igp]
|
||||
which attempt to match regexp against the pattern space
|
||||
and if successful replaces the matched portion with replacement.
|
||||
|
||||
aTEXT
|
||||
which appends TEXT after the pattern space
|
||||
Options:
|
||||
-e add the script to the commands to be executed
|
||||
-n suppress automatic printing of pattern space
|
||||
|
||||
This version of sed matches full regular expresions.
|
||||
|
||||
|
||||
________________________________________________________________________________________________________
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
rmdir [OPTION] ... directory
|
||||
|
||||
Remove directories if they are empty.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
________________________________________________________________________________________________________
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
rmdir [OPTION] ... directory
|
||||
|
||||
Remove directories if they are empty.
|
||||
|
||||
|
||||
|
||||
|
||||
________________________________________________________________________________________________________
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
sed
|
||||
|
||||
Sed scripts are subject to the following format: 's/regexp/replacement/[gp]' which attempts to
|
||||
|
||||
match regexp against the pattern space and if successful, replaces the matched portion with
|
||||
|
||||
replacement. This version of sed matches
|
||||
|
||||
full regular expressions.
|
||||
|
||||
-e Add the script to the commands to be executed.
|
||||
|
||||
-n Suppress automatic printing of pattern space..
|
||||
|
||||
-e Add the script to the commands to be executed.
|
||||
|
||||
-n Suppress automatic printing of pattern space..
|
||||
|
||||
-e Add the script to the commands to be executed.
|
||||
|
||||
-n Suppress automatic printing of pattern space.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
________________________________________________________________________________________________________
|
||||
|
||||
@ -977,9 +936,25 @@ ________________________________________________________________________________
|
||||
|
||||
zcat [options] files
|
||||
|
||||
Uncompress file from gzip, gunzip or compress command or standard input if file is '-'.
|
||||
Usage: zcat [OPTION]... FILE
|
||||
|
||||
-c Write output to standard output.
|
||||
Uncompress FILE (or standard input if FILE is '-').
|
||||
(When invoked as zcat, defaults to having -c turned on)
|
||||
|
||||
Options:
|
||||
-c Write output to standard output
|
||||
-t Test compressed file integrity
|
||||
|
||||
|
||||
|
||||
|
||||
________________________________________________________________________________________________________
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
gunzip (Same as zcat, but without the "-c" option.)
|
||||
|
||||
|
||||
|
||||
@ -991,22 +966,13 @@ ________________________________________________________________________________
|
||||
|
||||
|
||||
|
||||
gunzip (Same as zcat)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
________________________________________________________________________________________________________
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
gzip (Same as zcat)
|
||||
gzip [OPTION]... FILE
|
||||
|
||||
Compress FILE with maximum compression.
|
||||
When FILE is -, reads standard input. Implies -c.
|
||||
|
||||
Options:
|
||||
-c Write output to standard output instead of FILE.gz
|
||||
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
Name: busybox
|
||||
Version: 0.40
|
||||
Version: 0.41
|
||||
Release: 1
|
||||
Group: System/Utilities
|
||||
Summary: BusyBox is a tiny suite of Unix utilities in a multi-call binary.
|
||||
@ -21,7 +21,7 @@ embedded system.
|
||||
%setup -q -n %{Name}-%{Version}
|
||||
|
||||
%Build
|
||||
BB_INIT_SCRIPT='\"/etc/rc.d/init.d/rcS\"' make
|
||||
make
|
||||
|
||||
%Install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
44
init.c
44
init.c
@ -331,7 +331,7 @@ static void console_init()
|
||||
static pid_t run(char* command,
|
||||
char *terminal, int get_enter)
|
||||
{
|
||||
int i;
|
||||
int i, fd;
|
||||
pid_t pid;
|
||||
char* tmpCmd;
|
||||
char* cmd[255];
|
||||
@ -357,21 +357,20 @@ static pid_t run(char* command,
|
||||
close(2);
|
||||
setsid();
|
||||
|
||||
if (device_open(terminal, O_RDWR) < 0) {
|
||||
message(LOG|CONSOLE, "Bummer, can't open %s\r\n", terminal);
|
||||
exit(1);
|
||||
}
|
||||
dup(0);
|
||||
dup(0);
|
||||
tcsetpgrp (0, getpgrp());
|
||||
set_term(0);
|
||||
|
||||
/* Reset signal handlers set for parent process */
|
||||
signal(SIGUSR1, SIG_DFL);
|
||||
signal(SIGUSR2, SIG_DFL);
|
||||
signal(SIGINT, SIG_DFL);
|
||||
signal(SIGTERM, SIG_DFL);
|
||||
|
||||
if ((fd = device_open(terminal, O_RDWR)) < 0) {
|
||||
message(LOG|CONSOLE, "Bummer, can't open %s\r\n", terminal);
|
||||
exit(1);
|
||||
}
|
||||
dup(fd);
|
||||
dup(fd);
|
||||
tcsetpgrp (0, getpgrp());
|
||||
set_term(0);
|
||||
|
||||
if (get_enter==TRUE) {
|
||||
/*
|
||||
@ -389,19 +388,21 @@ static pid_t run(char* command,
|
||||
read(fileno(stdin), &c, 1);
|
||||
}
|
||||
|
||||
/* Log the process name and args */
|
||||
message(LOG|CONSOLE, "Starting pid %d, console %s: '",
|
||||
shell_pgid, terminal, command);
|
||||
|
||||
/* Convert command (char*) into cmd (char**, one word per string) */
|
||||
for (tmpCmd=command, i=0; (tmpCmd=strsep(&command, " \t")) != NULL;) {
|
||||
if (*tmpCmd != '\0') {
|
||||
cmd[i] = tmpCmd;
|
||||
message(LOG|CONSOLE, "%s ", tmpCmd);
|
||||
tmpCmd++;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
cmd[i] = NULL;
|
||||
|
||||
/* Log the process name and args */
|
||||
message(LOG, "Starting pid %d, console %s: '%s'\r\n",
|
||||
shell_pgid, terminal, cmd[0]);
|
||||
message(LOG|CONSOLE, "'\r\n");
|
||||
|
||||
/* Now run it. The new program will take over this PID,
|
||||
* so nothing further in init.c should be run. */
|
||||
@ -540,8 +541,8 @@ void new_initAction (initActionEnum action,
|
||||
} else
|
||||
strncpy(newAction->console, console, 255);
|
||||
newAction->pid = 0;
|
||||
// message(LOG|CONSOLE, "process='%s' action='%d' console='%s'\n",
|
||||
// newAction->process, newAction->action, newAction->console);
|
||||
message(LOG|CONSOLE, "process='%s' action='%d' console='%s'\n",
|
||||
newAction->process, newAction->action, newAction->console);
|
||||
}
|
||||
|
||||
void delete_initAction (initAction *action)
|
||||
@ -672,11 +673,8 @@ extern int init_main(int argc, char **argv)
|
||||
usage( "init\n\nInit is the parent of all processes.\n\n"
|
||||
"This version of init is designed to be run only by the kernel\n");
|
||||
}
|
||||
|
||||
/* from the controlling terminal */
|
||||
setsid();
|
||||
|
||||
/* Set up sig handlers -- be sure to clear all of these in run() */
|
||||
/* Set up sig handlers -- be sure to
|
||||
* clear all of these in run() */
|
||||
signal(SIGUSR1, halt_signal);
|
||||
signal(SIGUSR2, reboot_signal);
|
||||
signal(SIGINT, reboot_signal);
|
||||
@ -686,7 +684,7 @@ extern int init_main(int argc, char **argv)
|
||||
* SIGINT on CAD so we can shut things down gracefully... */
|
||||
reboot(RB_DISABLE_CAD);
|
||||
#endif
|
||||
|
||||
|
||||
/* Figure out where the default console should be */
|
||||
console_init();
|
||||
|
||||
@ -695,11 +693,11 @@ extern int init_main(int argc, char **argv)
|
||||
close(1);
|
||||
close(2);
|
||||
set_term(0);
|
||||
setsid();
|
||||
|
||||
/* Make sure PATH is set to something sane */
|
||||
putenv(_PATH_STDPATH);
|
||||
|
||||
|
||||
/* Hello world */
|
||||
#ifndef DEBUG_INIT
|
||||
message(LOG|CONSOLE,
|
||||
|
44
init/init.c
44
init/init.c
@ -331,7 +331,7 @@ static void console_init()
|
||||
static pid_t run(char* command,
|
||||
char *terminal, int get_enter)
|
||||
{
|
||||
int i;
|
||||
int i, fd;
|
||||
pid_t pid;
|
||||
char* tmpCmd;
|
||||
char* cmd[255];
|
||||
@ -357,21 +357,20 @@ static pid_t run(char* command,
|
||||
close(2);
|
||||
setsid();
|
||||
|
||||
if (device_open(terminal, O_RDWR) < 0) {
|
||||
message(LOG|CONSOLE, "Bummer, can't open %s\r\n", terminal);
|
||||
exit(1);
|
||||
}
|
||||
dup(0);
|
||||
dup(0);
|
||||
tcsetpgrp (0, getpgrp());
|
||||
set_term(0);
|
||||
|
||||
/* Reset signal handlers set for parent process */
|
||||
signal(SIGUSR1, SIG_DFL);
|
||||
signal(SIGUSR2, SIG_DFL);
|
||||
signal(SIGINT, SIG_DFL);
|
||||
signal(SIGTERM, SIG_DFL);
|
||||
|
||||
if ((fd = device_open(terminal, O_RDWR)) < 0) {
|
||||
message(LOG|CONSOLE, "Bummer, can't open %s\r\n", terminal);
|
||||
exit(1);
|
||||
}
|
||||
dup(fd);
|
||||
dup(fd);
|
||||
tcsetpgrp (0, getpgrp());
|
||||
set_term(0);
|
||||
|
||||
if (get_enter==TRUE) {
|
||||
/*
|
||||
@ -389,19 +388,21 @@ static pid_t run(char* command,
|
||||
read(fileno(stdin), &c, 1);
|
||||
}
|
||||
|
||||
/* Log the process name and args */
|
||||
message(LOG|CONSOLE, "Starting pid %d, console %s: '",
|
||||
shell_pgid, terminal, command);
|
||||
|
||||
/* Convert command (char*) into cmd (char**, one word per string) */
|
||||
for (tmpCmd=command, i=0; (tmpCmd=strsep(&command, " \t")) != NULL;) {
|
||||
if (*tmpCmd != '\0') {
|
||||
cmd[i] = tmpCmd;
|
||||
message(LOG|CONSOLE, "%s ", tmpCmd);
|
||||
tmpCmd++;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
cmd[i] = NULL;
|
||||
|
||||
/* Log the process name and args */
|
||||
message(LOG, "Starting pid %d, console %s: '%s'\r\n",
|
||||
shell_pgid, terminal, cmd[0]);
|
||||
message(LOG|CONSOLE, "'\r\n");
|
||||
|
||||
/* Now run it. The new program will take over this PID,
|
||||
* so nothing further in init.c should be run. */
|
||||
@ -540,8 +541,8 @@ void new_initAction (initActionEnum action,
|
||||
} else
|
||||
strncpy(newAction->console, console, 255);
|
||||
newAction->pid = 0;
|
||||
// message(LOG|CONSOLE, "process='%s' action='%d' console='%s'\n",
|
||||
// newAction->process, newAction->action, newAction->console);
|
||||
message(LOG|CONSOLE, "process='%s' action='%d' console='%s'\n",
|
||||
newAction->process, newAction->action, newAction->console);
|
||||
}
|
||||
|
||||
void delete_initAction (initAction *action)
|
||||
@ -672,11 +673,8 @@ extern int init_main(int argc, char **argv)
|
||||
usage( "init\n\nInit is the parent of all processes.\n\n"
|
||||
"This version of init is designed to be run only by the kernel\n");
|
||||
}
|
||||
|
||||
/* from the controlling terminal */
|
||||
setsid();
|
||||
|
||||
/* Set up sig handlers -- be sure to clear all of these in run() */
|
||||
/* Set up sig handlers -- be sure to
|
||||
* clear all of these in run() */
|
||||
signal(SIGUSR1, halt_signal);
|
||||
signal(SIGUSR2, reboot_signal);
|
||||
signal(SIGINT, reboot_signal);
|
||||
@ -686,7 +684,7 @@ extern int init_main(int argc, char **argv)
|
||||
* SIGINT on CAD so we can shut things down gracefully... */
|
||||
reboot(RB_DISABLE_CAD);
|
||||
#endif
|
||||
|
||||
|
||||
/* Figure out where the default console should be */
|
||||
console_init();
|
||||
|
||||
@ -695,11 +693,11 @@ extern int init_main(int argc, char **argv)
|
||||
close(1);
|
||||
close(2);
|
||||
set_term(0);
|
||||
setsid();
|
||||
|
||||
/* Make sure PATH is set to something sane */
|
||||
putenv(_PATH_STDPATH);
|
||||
|
||||
|
||||
/* Hello world */
|
||||
#ifndef DEBUG_INIT
|
||||
message(LOG|CONSOLE,
|
||||
|
@ -125,6 +125,7 @@ extern int touch_main(int argc, char** argv);
|
||||
extern int tput_main(int argc, char** argv);
|
||||
extern int true_main(int argc, char** argv);
|
||||
extern int tryopen_main(int argc, char** argv);
|
||||
extern int wc_main(int argc, char** argv);
|
||||
extern int umount_main(int argc, char** argv);
|
||||
extern int uniq_main(int argc, char** argv);
|
||||
extern int update_main(int argc, char** argv);
|
||||
|
4
mkdir.c
4
mkdir.c
@ -84,7 +84,7 @@ extern int mkdir_main(int argc, char **argv)
|
||||
|
||||
strcpy (buf, *argv);
|
||||
status=stat(buf, &statBuf);
|
||||
if (status != -1 && status != ENOENT ) {
|
||||
if (parentFlag == FALSE && status != -1 && status != ENOENT ) {
|
||||
fprintf(stderr, "%s: File exists\n", buf);
|
||||
exit( FALSE);
|
||||
}
|
||||
@ -93,7 +93,7 @@ extern int mkdir_main(int argc, char **argv)
|
||||
createPath(buf, mode);
|
||||
}
|
||||
else {
|
||||
if (mkdir (buf, mode) != 0) {
|
||||
if (mkdir (buf, mode) != 0 && parentFlag == FALSE) {
|
||||
perror(buf);
|
||||
exit( FALSE);
|
||||
}
|
||||
|
34
reg_test.sh
34
reg_test.sh
@ -9,7 +9,7 @@ if ! eval diff -u tar.c testdir ; then
|
||||
echo "Bummer. File copy failed."
|
||||
exit 0
|
||||
else
|
||||
echo "Cool. File copy is ok."
|
||||
echo "Cool. 'cp tar.c testdir' is ok."
|
||||
fi
|
||||
|
||||
rm -rf testdir
|
||||
@ -20,7 +20,7 @@ if ! eval diff -u tar.c testdir/foo/tar.c ; then
|
||||
echo "Bummer. File copy to a directory failed."
|
||||
exit 0
|
||||
else
|
||||
echo "Cool. File copy to a directory is ok."
|
||||
echo "Cool. 'cp tar.c testdir/foo' is ok."
|
||||
fi
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@ if ! eval diff -u tar.c testdir/foo/tar.c ; then
|
||||
echo "Bummer. File copy to a directory w/ a '/' failed."
|
||||
exit 0
|
||||
else
|
||||
echo "Cool. File copy to a directory w/ a '/' is ok."
|
||||
echo "Cool. 'cp tar.c testdir/foo/' is ok."
|
||||
fi
|
||||
|
||||
|
||||
@ -44,7 +44,7 @@ if ! eval diff -ur X11 testdir ; then
|
||||
echo "Bummer. Local dir copy failed."
|
||||
exit 0
|
||||
else
|
||||
echo "Cool. Local dir copy is ok."
|
||||
echo "Cool. 'cp -a X11 testdir' is ok."
|
||||
fi
|
||||
|
||||
rm -rf testdir X11
|
||||
@ -55,7 +55,7 @@ if ! eval diff -ur X11 testdir ; then
|
||||
echo "Bummer. Local dir copy w/ a '/' failed."
|
||||
exit 0
|
||||
else
|
||||
echo "Cool. Local dir copy w/ a '/' is ok."
|
||||
echo "Cool. 'cp -a X11 testdir/' is ok."
|
||||
fi
|
||||
|
||||
rm -rf testdir X11
|
||||
@ -66,7 +66,7 @@ if ! eval diff -ur X11 testdir ; then
|
||||
echo "Bummer. Local dir copy w/ a src '/' failed."
|
||||
exit 0
|
||||
else
|
||||
echo "Cool. Local dir copy w/ a src '/' is ok."
|
||||
echo "Cool. 'cp -a X11/ testdir' is ok."
|
||||
fi
|
||||
|
||||
rm -rf testdir X11
|
||||
@ -77,7 +77,7 @@ if ! eval diff -ur X11 testdir ; then
|
||||
echo "Bummer. Local dir copy w/ 2x '/'s failed."
|
||||
exit 0
|
||||
else
|
||||
echo "Cool. Local dir copy w/ 2x '/'s is ok."
|
||||
echo "Cool. 'cp -a X11/ testdir/' is ok."
|
||||
fi
|
||||
|
||||
rm -rf testdir X11
|
||||
@ -86,7 +86,7 @@ if ! eval diff -ur /etc/X11 testdir ; then
|
||||
echo "Bummer. Remote dir copy failed."
|
||||
exit 0
|
||||
else
|
||||
echo "Cool. Remote dir copy is ok."
|
||||
echo "Cool. 'cp -a /etc/X11 testdir' is ok."
|
||||
fi
|
||||
|
||||
|
||||
@ -98,7 +98,7 @@ if ! eval diff -ur /etc/X11 testdir/foo ; then
|
||||
echo "Bummer. Remote dir copy to a directory failed."
|
||||
exit 0
|
||||
else
|
||||
echo "Cool. Remote dir copy to a directory is ok."
|
||||
echo "Cool. 'cp -a /etc/X11 testdir/foo' is ok."
|
||||
fi
|
||||
|
||||
|
||||
@ -110,7 +110,7 @@ if ! eval diff -ur /etc/X11 testdir/foo ; then
|
||||
echo "Bummer. Remote dir copy to a directory w/ a '/' failed."
|
||||
exit 0
|
||||
else
|
||||
echo "Cool. Remote dir copy to a directory w/ a '/' is ok."
|
||||
echo "Cool. 'cp -a /etc/X11 testdir/foo/' is ok."
|
||||
fi
|
||||
|
||||
rm -rf testdir
|
||||
@ -124,14 +124,24 @@ if ! eval ./busybox cp README foo ; then
|
||||
echo "Bummer. cp README foo failed."
|
||||
exit 0
|
||||
else
|
||||
echo "Cool. cp README foo is ok."
|
||||
echo "Cool. 'cp README foo' is ok."
|
||||
fi
|
||||
|
||||
if ! eval ./busybox cp foo/README bar ; then
|
||||
echo "Bummer. cp foo/README bar failed."
|
||||
exit 0
|
||||
else
|
||||
echo "Cool. cp foo/README bar is ok."
|
||||
echo "Cool. 'cp foo/README bar' is ok."
|
||||
fi
|
||||
|
||||
rm -f bar/README
|
||||
ENVVAR1=foo
|
||||
ENVVAR2=bar
|
||||
if ! eval ./busybox cp $ENVVAR1/README $ENVVAR2 ; then
|
||||
echo "Bummer. cp foo/README bar failed."
|
||||
exit 0
|
||||
else
|
||||
echo "Cool. 'cp \$ENVVAR1/README \$ENVVAR2' is ok."
|
||||
fi
|
||||
|
||||
rm -rf foo bar
|
||||
|
@ -337,11 +337,13 @@ extern int syslogd_main(int argc, char **argv)
|
||||
#ifdef BB_KLOGD
|
||||
int startKlogd = TRUE;
|
||||
#endif
|
||||
int stopDoingThat = FALSE;
|
||||
char *p;
|
||||
char **argv1=argv;
|
||||
|
||||
while (--argc > 0 && **(++argv1) == '-') {
|
||||
while (*(++(*argv1))) {
|
||||
stopDoingThat = FALSE;
|
||||
while (stopDoingThat == FALSE && *(++(*argv1))) {
|
||||
switch (**argv1) {
|
||||
case 'm':
|
||||
if (--argc == 0) {
|
||||
@ -362,6 +364,7 @@ extern int syslogd_main(int argc, char **argv)
|
||||
usage(syslogd_usage);
|
||||
}
|
||||
logFilePath = *(++argv1);
|
||||
stopDoingThat = TRUE;
|
||||
break;
|
||||
default:
|
||||
usage(syslogd_usage);
|
||||
|
@ -337,11 +337,13 @@ extern int syslogd_main(int argc, char **argv)
|
||||
#ifdef BB_KLOGD
|
||||
int startKlogd = TRUE;
|
||||
#endif
|
||||
int stopDoingThat = FALSE;
|
||||
char *p;
|
||||
char **argv1=argv;
|
||||
|
||||
while (--argc > 0 && **(++argv1) == '-') {
|
||||
while (*(++(*argv1))) {
|
||||
stopDoingThat = FALSE;
|
||||
while (stopDoingThat == FALSE && *(++(*argv1))) {
|
||||
switch (**argv1) {
|
||||
case 'm':
|
||||
if (--argc == 0) {
|
||||
@ -362,6 +364,7 @@ extern int syslogd_main(int argc, char **argv)
|
||||
usage(syslogd_usage);
|
||||
}
|
||||
logFilePath = *(++argv1);
|
||||
stopDoingThat = TRUE;
|
||||
break;
|
||||
default:
|
||||
usage(syslogd_usage);
|
||||
|
@ -27,12 +27,12 @@
|
||||
extern int
|
||||
true_main(int argc, char** argv)
|
||||
{
|
||||
return( TRUE);
|
||||
exit( TRUE);
|
||||
}
|
||||
|
||||
extern int
|
||||
false_main(int argc, char** argv)
|
||||
{
|
||||
return( FALSE);
|
||||
exit( FALSE);
|
||||
}
|
||||
|
||||
|
11
utility.c
11
utility.c
@ -396,7 +396,7 @@ recursiveAction(const char *fileName, int recurse, int followLinks, int depthFir
|
||||
int (*dirAction) (const char *fileName, struct stat* statbuf))
|
||||
{
|
||||
int status;
|
||||
struct stat statbuf;
|
||||
struct stat statbuf, statbuf1;
|
||||
struct dirent *next;
|
||||
|
||||
if (followLinks == TRUE)
|
||||
@ -404,6 +404,7 @@ recursiveAction(const char *fileName, int recurse, int followLinks, int depthFir
|
||||
else
|
||||
status = lstat(fileName, &statbuf);
|
||||
|
||||
status = lstat(fileName, &statbuf);
|
||||
if (status < 0) {
|
||||
perror(fileName);
|
||||
return (FALSE);
|
||||
@ -424,8 +425,14 @@ recursiveAction(const char *fileName, int recurse, int followLinks, int depthFir
|
||||
return (TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
status = lstat(fileName, &statbuf1);
|
||||
if (status < 0) {
|
||||
perror(fileName);
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
if (S_ISDIR(statbuf.st_mode)) {
|
||||
if (S_ISDIR(statbuf.st_mode) && S_ISDIR(statbuf1.st_mode)) {
|
||||
DIR *dir;
|
||||
dir = opendir(fileName);
|
||||
if (!dir) {
|
||||
|
Loading…
Reference in New Issue
Block a user