diff options
author | Eric Andersen <andersen@codepoet.org> | 1999-11-13 04:47:09 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 1999-11-13 04:47:09 +0000 |
commit | b6a44b8d39b7834ab9f6c43938f4b58f135e846e (patch) | |
tree | d9bd903d4e30ea4faf1977a514853c5aac83690c | |
parent | eded54bd96ed0394844f9ba23c5ab54dff8a917f (diff) | |
download | busybox-w32-b6a44b8d39b7834ab9f6c43938f4b58f135e846e.tar.gz busybox-w32-b6a44b8d39b7834ab9f6c43938f4b58f135e846e.tar.bz2 busybox-w32-b6a44b8d39b7834ab9f6c43938f4b58f135e846e.zip |
updates for the day
-rw-r--r-- | Changelog | 12 | ||||
-rw-r--r-- | archival/tar.c | 1 | ||||
-rw-r--r-- | busybox.def.h | 6 | ||||
-rw-r--r-- | coreutils/dd.c | 2 | ||||
-rw-r--r-- | dd.c | 2 | ||||
-rw-r--r-- | init.c | 30 | ||||
-rw-r--r-- | init/init.c | 30 | ||||
-rw-r--r-- | mnc.c | 14 | ||||
-rw-r--r-- | regexp.c | 2 | ||||
-rw-r--r-- | tar.c | 1 | ||||
-rw-r--r-- | umount.c | 2 | ||||
-rw-r--r-- | util-linux/umount.c | 2 | ||||
-rw-r--r-- | utility.c | 6 |
13 files changed, 65 insertions, 45 deletions
@@ -1,3 +1,15 @@ | |||
1 | 0.36 | ||
2 | * fixed dd so it properly defaults to stdin and stdout when no | ||
3 | if= and of= are set (fix thanks to Eric Delaunay). | ||
4 | * Don't try to close the file descriptor of a pipe. (fix also from | ||
5 | Eric Delaunay). | ||
6 | * Made createPath be quiet (again thanks to Eric Delaunay). | ||
7 | * If BB_CONSOLE_CMD_IF_RC_SCRIPT_EXITS is defined, then whatever | ||
8 | command you define it as will be run if the init script exits. | ||
9 | * Made createPath be quiet (again thanks to Eric Delaunay). | ||
10 | |||
11 | -Erik Andersen | ||
12 | |||
1 | 0.35 | 13 | 0.35 |
2 | * gzip now obeys the principle of least surprise and acts like god intended | 14 | * gzip now obeys the principle of least surprise and acts like god intended |
3 | (i.e. it accepts a file name, answers --help, and obeys the '-c' flag | 15 | (i.e. it accepts a file name, answers --help, and obeys the '-c' flag |
diff --git a/archival/tar.c b/archival/tar.c index 5478af86e..1fdbf8c1c 100644 --- a/archival/tar.c +++ b/archival/tar.c | |||
@@ -559,6 +559,7 @@ readHeader (const TarHeader * hp, int fileCount, char **fileTable) | |||
559 | outFd = mknod (name, mode, makedev(major, minor) ); | 559 | outFd = mknod (name, mode, makedev(major, minor) ); |
560 | } | 560 | } |
561 | else if (S_ISFIFO(mode) ) { | 561 | else if (S_ISFIFO(mode) ) { |
562 | devFileFlag = TRUE; | ||
562 | outFd = mkfifo(name, mode); | 563 | outFd = mkfifo(name, mode); |
563 | } else { | 564 | } else { |
564 | outFd = open (name, O_WRONLY | O_CREAT | O_TRUNC, mode); | 565 | outFd = open (name, O_WRONLY | O_CREAT | O_TRUNC, mode); |
diff --git a/busybox.def.h b/busybox.def.h index 5896861de..6e2b818d6 100644 --- a/busybox.def.h +++ b/busybox.def.h | |||
@@ -17,7 +17,7 @@ | |||
17 | //#define BB_FDFLUSH | 17 | //#define BB_FDFLUSH |
18 | #define BB_FIND | 18 | #define BB_FIND |
19 | #define BB_FSCK_MINIX | 19 | #define BB_FSCK_MINIX |
20 | //#define BB_MKFS_MINIX | 20 | #define BB_MKFS_MINIX |
21 | #define BB_CHVT | 21 | #define BB_CHVT |
22 | #define BB_DEALLOCVT | 22 | #define BB_DEALLOCVT |
23 | #define BB_GREP | 23 | #define BB_GREP |
@@ -34,7 +34,7 @@ | |||
34 | #define BB_MKDIR | 34 | #define BB_MKDIR |
35 | #define BB_MKNOD | 35 | #define BB_MKNOD |
36 | #define BB_MKSWAP | 36 | #define BB_MKSWAP |
37 | //#define BB_MNC | 37 | #define BB_MNC |
38 | #define BB_MORE | 38 | #define BB_MORE |
39 | #define BB_MOUNT | 39 | #define BB_MOUNT |
40 | //#define BB_MT | 40 | //#define BB_MT |
@@ -54,7 +54,7 @@ | |||
54 | #define BB_SYNC | 54 | #define BB_SYNC |
55 | #define BB_TAR | 55 | #define BB_TAR |
56 | #define BB_TOUCH | 56 | #define BB_TOUCH |
57 | //#define BB_TRUE_FALSE // Supplied by ash | 57 | #define BB_TRUE_FALSE |
58 | #define BB_UMOUNT | 58 | #define BB_UMOUNT |
59 | #define BB_UPDATE | 59 | #define BB_UPDATE |
60 | #define BB_UNAME | 60 | #define BB_UNAME |
diff --git a/coreutils/dd.c b/coreutils/dd.c index 800ed59f8..9468cddfc 100644 --- a/coreutils/dd.c +++ b/coreutils/dd.c | |||
@@ -152,8 +152,6 @@ extern int dd_main (int argc, char **argv) | |||
152 | argc--; | 152 | argc--; |
153 | argv++; | 153 | argv++; |
154 | } | 154 | } |
155 | if ( inFile == NULL || outFile == NULL) | ||
156 | goto usage; | ||
157 | 155 | ||
158 | buf = malloc (blockSize); | 156 | buf = malloc (blockSize); |
159 | if (buf == NULL) { | 157 | if (buf == NULL) { |
@@ -152,8 +152,6 @@ extern int dd_main (int argc, char **argv) | |||
152 | argc--; | 152 | argc--; |
153 | argv++; | 153 | argv++; |
154 | } | 154 | } |
155 | if ( inFile == NULL || outFile == NULL) | ||
156 | goto usage; | ||
157 | 155 | ||
158 | buf = malloc (blockSize); | 156 | buf = malloc (blockSize); |
159 | if (buf == NULL) { | 157 | if (buf == NULL) { |
@@ -417,10 +417,14 @@ extern int init_main(int argc, char **argv) | |||
417 | pid_t pid1 = 0; | 417 | pid_t pid1 = 0; |
418 | pid_t pid2 = 0; | 418 | pid_t pid2 = 0; |
419 | struct stat statbuf; | 419 | struct stat statbuf; |
420 | const char* const init_commands[] = { INITSCRIPT, INITSCRIPT, 0}; | 420 | const char* const rc_script_command[] = { INITSCRIPT, INITSCRIPT, 0}; |
421 | const char* const shell_commands[] = { SHELL, "-" SHELL, 0}; | 421 | const char* const shell_command[] = { SHELL, "-" SHELL, 0}; |
422 | const char* const* tty0_commands = shell_commands; | 422 | const char* const* tty0_command = shell_command; |
423 | const char* const* tty1_commands = shell_commands; | 423 | const char* const* tty1_command = shell_command; |
424 | #ifdef BB_CONSOLE_CMD_IF_RC_SCRIPT_EXITS | ||
425 | const char* const rc_exit_command[] = BB_CONSOLE_CMD_IF_RC_SCRIPT_EXITS; | ||
426 | #endif | ||
427 | |||
424 | #ifdef DEBUG_INIT | 428 | #ifdef DEBUG_INIT |
425 | char *hello_msg_format = | 429 | char *hello_msg_format = |
426 | "init(%d) started: BusyBox v%s (%s) multi-call binary\r\n"; | 430 | "init(%d) started: BusyBox v%s (%s) multi-call binary\r\n"; |
@@ -493,7 +497,7 @@ extern int init_main(int argc, char **argv) | |||
493 | /* Make sure an init script exists before trying to run it */ | 497 | /* Make sure an init script exists before trying to run it */ |
494 | if (run_rc == TRUE && stat(INITSCRIPT, &statbuf)==0) { | 498 | if (run_rc == TRUE && stat(INITSCRIPT, &statbuf)==0) { |
495 | wait_for_enter = FALSE; | 499 | wait_for_enter = FALSE; |
496 | tty0_commands = init_commands; | 500 | tty0_command = rc_script_command; |
497 | } | 501 | } |
498 | 502 | ||
499 | 503 | ||
@@ -504,11 +508,11 @@ extern int init_main(int argc, char **argv) | |||
504 | pid_t wpid; | 508 | pid_t wpid; |
505 | int status; | 509 | int status; |
506 | 510 | ||
507 | if (pid1 == 0 && tty0_commands) { | 511 | if (pid1 == 0 && tty0_command) { |
508 | pid1 = run(tty0_commands, console, wait_for_enter); | 512 | pid1 = run(tty0_command, console, wait_for_enter); |
509 | } | 513 | } |
510 | if (pid2 == 0 && tty1_commands && second_console) { | 514 | if (pid2 == 0 && tty1_command && second_console) { |
511 | pid2 = run(tty1_commands, second_console, TRUE); | 515 | pid2 = run(tty1_command, second_console, TRUE); |
512 | } | 516 | } |
513 | wpid = wait(&status); | 517 | wpid = wait(&status); |
514 | if (wpid > 0 ) { | 518 | if (wpid > 0 ) { |
@@ -518,13 +522,13 @@ extern int init_main(int argc, char **argv) | |||
518 | if (wpid == pid1) { | 522 | if (wpid == pid1) { |
519 | if (run_rc == FALSE) { | 523 | if (run_rc == FALSE) { |
520 | pid1 = 0; | 524 | pid1 = 0; |
521 | } | 525 | } |
522 | #if 0 | 526 | #ifdef BB_CONSOLE_CMD_IF_RC_SCRIPT_EXITS |
523 | /* Turn this on to start a shell on the console if the init script exits.... */ | ||
524 | else { | 527 | else { |
528 | pid1 = 0; | ||
525 | run_rc=FALSE; | 529 | run_rc=FALSE; |
526 | wait_for_enter=TRUE; | 530 | wait_for_enter=TRUE; |
527 | tty0_commands=shell_commands; | 531 | tty0_command=rc_exit_command; |
528 | } | 532 | } |
529 | #endif | 533 | #endif |
530 | } | 534 | } |
diff --git a/init/init.c b/init/init.c index e70d5a15d..a3e8d6700 100644 --- a/init/init.c +++ b/init/init.c | |||
@@ -417,10 +417,14 @@ extern int init_main(int argc, char **argv) | |||
417 | pid_t pid1 = 0; | 417 | pid_t pid1 = 0; |
418 | pid_t pid2 = 0; | 418 | pid_t pid2 = 0; |
419 | struct stat statbuf; | 419 | struct stat statbuf; |
420 | const char* const init_commands[] = { INITSCRIPT, INITSCRIPT, 0}; | 420 | const char* const rc_script_command[] = { INITSCRIPT, INITSCRIPT, 0}; |
421 | const char* const shell_commands[] = { SHELL, "-" SHELL, 0}; | 421 | const char* const shell_command[] = { SHELL, "-" SHELL, 0}; |
422 | const char* const* tty0_commands = shell_commands; | 422 | const char* const* tty0_command = shell_command; |
423 | const char* const* tty1_commands = shell_commands; | 423 | const char* const* tty1_command = shell_command; |
424 | #ifdef BB_CONSOLE_CMD_IF_RC_SCRIPT_EXITS | ||
425 | const char* const rc_exit_command[] = BB_CONSOLE_CMD_IF_RC_SCRIPT_EXITS; | ||
426 | #endif | ||
427 | |||
424 | #ifdef DEBUG_INIT | 428 | #ifdef DEBUG_INIT |
425 | char *hello_msg_format = | 429 | char *hello_msg_format = |
426 | "init(%d) started: BusyBox v%s (%s) multi-call binary\r\n"; | 430 | "init(%d) started: BusyBox v%s (%s) multi-call binary\r\n"; |
@@ -493,7 +497,7 @@ extern int init_main(int argc, char **argv) | |||
493 | /* Make sure an init script exists before trying to run it */ | 497 | /* Make sure an init script exists before trying to run it */ |
494 | if (run_rc == TRUE && stat(INITSCRIPT, &statbuf)==0) { | 498 | if (run_rc == TRUE && stat(INITSCRIPT, &statbuf)==0) { |
495 | wait_for_enter = FALSE; | 499 | wait_for_enter = FALSE; |
496 | tty0_commands = init_commands; | 500 | tty0_command = rc_script_command; |
497 | } | 501 | } |
498 | 502 | ||
499 | 503 | ||
@@ -504,11 +508,11 @@ extern int init_main(int argc, char **argv) | |||
504 | pid_t wpid; | 508 | pid_t wpid; |
505 | int status; | 509 | int status; |
506 | 510 | ||
507 | if (pid1 == 0 && tty0_commands) { | 511 | if (pid1 == 0 && tty0_command) { |
508 | pid1 = run(tty0_commands, console, wait_for_enter); | 512 | pid1 = run(tty0_command, console, wait_for_enter); |
509 | } | 513 | } |
510 | if (pid2 == 0 && tty1_commands && second_console) { | 514 | if (pid2 == 0 && tty1_command && second_console) { |
511 | pid2 = run(tty1_commands, second_console, TRUE); | 515 | pid2 = run(tty1_command, second_console, TRUE); |
512 | } | 516 | } |
513 | wpid = wait(&status); | 517 | wpid = wait(&status); |
514 | if (wpid > 0 ) { | 518 | if (wpid > 0 ) { |
@@ -518,13 +522,13 @@ extern int init_main(int argc, char **argv) | |||
518 | if (wpid == pid1) { | 522 | if (wpid == pid1) { |
519 | if (run_rc == FALSE) { | 523 | if (run_rc == FALSE) { |
520 | pid1 = 0; | 524 | pid1 = 0; |
521 | } | 525 | } |
522 | #if 0 | 526 | #ifdef BB_CONSOLE_CMD_IF_RC_SCRIPT_EXITS |
523 | /* Turn this on to start a shell on the console if the init script exits.... */ | ||
524 | else { | 527 | else { |
528 | pid1 = 0; | ||
525 | run_rc=FALSE; | 529 | run_rc=FALSE; |
526 | wait_for_enter=TRUE; | 530 | wait_for_enter=TRUE; |
527 | tty0_commands=shell_commands; | 531 | tty0_command=rc_exit_command; |
528 | } | 532 | } |
529 | #endif | 533 | #endif |
530 | } | 534 | } |
@@ -40,8 +40,8 @@ | |||
40 | #define BUFSIZE 100 | 40 | #define BUFSIZE 100 |
41 | 41 | ||
42 | static const char mnc_usage[] = | 42 | static const char mnc_usage[] = |
43 | "mini-netcat 0.0.3 -- Open pipe to IP:port\n" | 43 | "mnc [IP] [port]\n\n" |
44 | "\tmnc [IP] [port]\n"; | 44 | "mini-netcat opens a pipe to IP:port\n"; |
45 | 45 | ||
46 | int | 46 | int |
47 | mnc_main(int argc, char **argv) | 47 | mnc_main(int argc, char **argv) |
@@ -56,9 +56,15 @@ mnc_main(int argc, char **argv) | |||
56 | 56 | ||
57 | fd_set readfds, testfds; | 57 | fd_set readfds, testfds; |
58 | 58 | ||
59 | if (argc<=1 || **(argv+1) == '-' ) { | ||
60 | usage( mnc_usage); | ||
61 | } | ||
62 | argc--; | ||
63 | argv++; | ||
64 | |||
59 | sfd = socket(AF_INET, SOCK_STREAM, 0); | 65 | sfd = socket(AF_INET, SOCK_STREAM, 0); |
60 | 66 | ||
61 | hostinfo = (struct hostent *) gethostbyname(argv[1]); | 67 | hostinfo = (struct hostent *) gethostbyname(*argv); |
62 | 68 | ||
63 | if (!hostinfo) | 69 | if (!hostinfo) |
64 | { | 70 | { |
@@ -67,7 +73,7 @@ mnc_main(int argc, char **argv) | |||
67 | 73 | ||
68 | address.sin_family = AF_INET; | 74 | address.sin_family = AF_INET; |
69 | address.sin_addr = *(struct in_addr *) *hostinfo->h_addr_list; | 75 | address.sin_addr = *(struct in_addr *) *hostinfo->h_addr_list; |
70 | address.sin_port = htons(atoi(argv[2])); | 76 | address.sin_port = htons(atoi(*(++argv))); |
71 | 77 | ||
72 | len = sizeof(address); | 78 | len = sizeof(address); |
73 | 79 | ||
@@ -135,7 +135,7 @@ static char *retext; /* points to the text being compiled */ | |||
135 | 135 | ||
136 | /* error-handling stuff */ | 136 | /* error-handling stuff */ |
137 | jmp_buf errorhandler; | 137 | jmp_buf errorhandler; |
138 | #define FAIL(why) fprintf(stderr, why); longjmp(errorhandler, 1) | 138 | #define FAIL(why) do {fprintf(stderr, why); longjmp(errorhandler, 1);} while (0) |
139 | 139 | ||
140 | 140 | ||
141 | 141 | ||
@@ -559,6 +559,7 @@ readHeader (const TarHeader * hp, int fileCount, char **fileTable) | |||
559 | outFd = mknod (name, mode, makedev(major, minor) ); | 559 | outFd = mknod (name, mode, makedev(major, minor) ); |
560 | } | 560 | } |
561 | else if (S_ISFIFO(mode) ) { | 561 | else if (S_ISFIFO(mode) ) { |
562 | devFileFlag = TRUE; | ||
562 | outFd = mkfifo(name, mode); | 563 | outFd = mkfifo(name, mode); |
563 | } else { | 564 | } else { |
564 | outFd = open (name, O_WRONLY | O_CREAT | O_TRUNC, mode); | 565 | outFd = open (name, O_WRONLY | O_CREAT | O_TRUNC, mode); |
@@ -124,7 +124,7 @@ umount_main(int argc, char** argv) | |||
124 | } | 124 | } |
125 | 125 | ||
126 | 126 | ||
127 | if(umountAll) { | 127 | if(umountAll==TRUE) { |
128 | exit(umount_all(useMtab)); | 128 | exit(umount_all(useMtab)); |
129 | } | 129 | } |
130 | if ( do_umount(*argv,useMtab) == 0 ) | 130 | if ( do_umount(*argv,useMtab) == 0 ) |
diff --git a/util-linux/umount.c b/util-linux/umount.c index 0d105d9c1..061bb9b16 100644 --- a/util-linux/umount.c +++ b/util-linux/umount.c | |||
@@ -124,7 +124,7 @@ umount_main(int argc, char** argv) | |||
124 | } | 124 | } |
125 | 125 | ||
126 | 126 | ||
127 | if(umountAll) { | 127 | if(umountAll==TRUE) { |
128 | exit(umount_all(useMtab)); | 128 | exit(umount_all(useMtab)); |
129 | } | 129 | } |
130 | if ( do_umount(*argv,useMtab) == 0 ) | 130 | if ( do_umount(*argv,useMtab) == 0 ) |
@@ -488,12 +488,8 @@ extern void createPath (const char *name, int mode) | |||
488 | while (cp) { | 488 | while (cp) { |
489 | cpOld = cp; | 489 | cpOld = cp; |
490 | cp = strchr (cp + 1, '/'); | 490 | cp = strchr (cp + 1, '/'); |
491 | |||
492 | *cpOld = '\0'; | 491 | *cpOld = '\0'; |
493 | 492 | mkdir (buf, cp ? 0777 : mode); | |
494 | if (mkdir (buf, cp ? 0777 : mode) == 0) | ||
495 | printf ("Directory \"%s\" created\n", buf); | ||
496 | |||
497 | *cpOld = '/'; | 493 | *cpOld = '/'; |
498 | } | 494 | } |
499 | } | 495 | } |