aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2007-02-16 17:17:07 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2007-02-16 17:17:07 +0000
commitd818dcc72adb995309e5423382a825e9e342c971 (patch)
tree0bda18715baff6af08c0daedf07c223f5e4e38d0
parent7fd00cbff72f7ac46eddef7366e32780cb364fae (diff)
downloadbusybox-w32-d818dcc72adb995309e5423382a825e9e342c971.tar.gz
busybox-w32-d818dcc72adb995309e5423382a825e9e342c971.tar.bz2
busybox-w32-d818dcc72adb995309e5423382a825e9e342c971.zip
- whitespace cleanup and add a possible shrinkage suggestion
-rw-r--r--init/init.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/init/init.c b/init/init.c
index ce1f7391a..76368fb2e 100644
--- a/init/init.c
+++ b/init/init.c
@@ -577,7 +577,7 @@ static int waitfor(const struct init_action *a, pid_t pid)
577 577
578 runpid = (NULL == a)? pid : run(a); 578 runpid = (NULL == a)? pid : run(a);
579 while (1) { 579 while (1) {
580 wpid = waitpid(runpid,&status,0); 580 wpid = waitpid(runpid, &status, 0);
581 if (wpid == runpid) 581 if (wpid == runpid)
582 break; 582 break;
583 if (wpid == -1 && errno == ECHILD) { 583 if (wpid == -1 && errno == ECHILD) {
@@ -793,7 +793,7 @@ static void new_init_action(int action, const char *command, const char *cons)
793 /* don't enter action if it's already in the list, 793 /* don't enter action if it's already in the list,
794 * but do overwrite existing actions */ 794 * but do overwrite existing actions */
795 if ((strcmp(a->command, command) == 0) && 795 if ((strcmp(a->command, command) == 0) &&
796 (strcmp(a->terminal, cons) ==0)) { 796 (strcmp(a->terminal, cons) == 0)) {
797 a->action = action; 797 a->action = action;
798 free(new_action); 798 free(new_action);
799 return; 799 return;
@@ -855,7 +855,7 @@ static void parse_inittab(void)
855 /* Umount all filesystems on halt/reboot */ 855 /* Umount all filesystems on halt/reboot */
856 new_init_action(SHUTDOWN, "umount -a -r", ""); 856 new_init_action(SHUTDOWN, "umount -a -r", "");
857 /* Swapoff on halt/reboot */ 857 /* Swapoff on halt/reboot */
858 if(ENABLE_SWAPONOFF) new_init_action(SHUTDOWN, "swapoff -a", ""); 858 if (ENABLE_SWAPONOFF) new_init_action(SHUTDOWN, "swapoff -a", "");
859 /* Prepare to restart init when a HUP is received */ 859 /* Prepare to restart init when a HUP is received */
860 new_init_action(RESTART, "init", ""); 860 new_init_action(RESTART, "init", "");
861 /* Askfirst shell on tty1-4 */ 861 /* Askfirst shell on tty1-4 */
@@ -879,6 +879,7 @@ static void parse_inittab(void)
879 continue; 879 continue;
880 880
881 /* Trim the trailing \n */ 881 /* Trim the trailing \n */
882 //XXX: chomp() ?
882 eol = strrchr(id, '\n'); 883 eol = strrchr(id, '\n');
883 if (eol != NULL) 884 if (eol != NULL)
884 *eol = '\0'; 885 *eol = '\0';