aboutsummaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authoraldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277>2007-02-16 17:17:07 +0000
committeraldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277>2007-02-16 17:17:07 +0000
commitcb21db2c4bf3c7f65b929a82c948335961b1583c (patch)
tree0bda18715baff6af08c0daedf07c223f5e4e38d0 /init
parent673d7d35e8337a779761f0dec4ee9b8e290ec862 (diff)
downloadbusybox-w32-cb21db2c4bf3c7f65b929a82c948335961b1583c.tar.gz
busybox-w32-cb21db2c4bf3c7f65b929a82c948335961b1583c.tar.bz2
busybox-w32-cb21db2c4bf3c7f65b929a82c948335961b1583c.zip
- whitespace cleanup and add a possible shrinkage suggestion
git-svn-id: svn://busybox.net/trunk/busybox@17909 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'init')
-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';