aboutsummaryrefslogtreecommitdiff
path: root/hush.c
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-06-26 23:00:21 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-06-26 23:00:21 +0000
commitf22f4db7fc18cd73bff9fe886b4a006a85b68f4d (patch)
treea2ba0790f64c246b8e95d6204b90124ce7d1e5f1 /hush.c
parentda5a056306740578aa61dc802257734becb55726 (diff)
downloadbusybox-w32-f22f4db7fc18cd73bff9fe886b4a006a85b68f4d.tar.gz
busybox-w32-f22f4db7fc18cd73bff9fe886b4a006a85b68f4d.tar.bz2
busybox-w32-f22f4db7fc18cd73bff9fe886b4a006a85b68f4d.zip
Don't choke if /etc/profile is not available
git-svn-id: svn://busybox.net/trunk/busybox@2913 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'hush.c')
-rw-r--r--hush.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/hush.c b/hush.c
index 859353dcf..f70074f14 100644
--- a/hush.c
+++ b/hush.c
@@ -2556,9 +2556,7 @@ static void setup_job_control()
2556 2556
2557 /* Put ourselves in our own process group. */ 2557 /* Put ourselves in our own process group. */
2558 shell_pgrp = getpid (); 2558 shell_pgrp = getpid ();
2559 if (setpgid (shell_pgrp, shell_pgrp) < 0) { 2559 setpgid (shell_pgrp, shell_pgrp);
2560 perror_msg_and_die("Couldn't put the shell in its own process group");
2561 }
2562 2560
2563 /* Grab control of the terminal. */ 2561 /* Grab control of the terminal. */
2564 tcsetpgrp(shell_terminal, shell_pgrp); 2562 tcsetpgrp(shell_terminal, shell_pgrp);
@@ -2607,11 +2605,12 @@ int shell_main(int argc, char **argv)
2607 2605
2608 if (argv[0] && argv[0][0] == '-') { 2606 if (argv[0] && argv[0][0] == '-') {
2609 debug_printf("\nsourcing /etc/profile\n"); 2607 debug_printf("\nsourcing /etc/profile\n");
2610 input = xfopen("/etc/profile", "r"); 2608 if ((input = fopen("/etc/profile", "r")) != NULL) {
2611 mark_open(fileno(input)); 2609 mark_open(fileno(input));
2612 parse_file_outer(input); 2610 parse_file_outer(input);
2613 mark_closed(fileno(input)); 2611 mark_closed(fileno(input));
2614 fclose(input); 2612 fclose(input);
2613 }
2615 } 2614 }
2616 input=stdin; 2615 input=stdin;
2617 2616