aboutsummaryrefslogtreecommitdiff
path: root/miscutils/crontab.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2012-03-22 13:56:39 +0000
committerRon Yorston <rmy@pobox.com>2012-03-22 13:56:39 +0000
commit811c449748d5bd0505f8510e5582892f94ac0cda (patch)
tree2640249cb2a9605c7cd59467b9861b205e9bcc8a /miscutils/crontab.c
parentc0d4367d6b581eb5989c02815880cf0fa2851ae8 (diff)
parent19311bfa7b8e8c6effa9c375de9b0eb4338bee12 (diff)
downloadbusybox-w32-811c449748d5bd0505f8510e5582892f94ac0cda.tar.gz
busybox-w32-811c449748d5bd0505f8510e5582892f94ac0cda.tar.bz2
busybox-w32-811c449748d5bd0505f8510e5582892f94ac0cda.zip
Merge commit '19311bfa7b8e8c6effa9c375de9b0eb4338bee12' into merge
Conflicts: coreutils/ls.c shell/ash.c
Diffstat (limited to 'miscutils/crontab.c')
-rw-r--r--miscutils/crontab.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/miscutils/crontab.c b/miscutils/crontab.c
index 163e15dce..16d7fdf69 100644
--- a/miscutils/crontab.c
+++ b/miscutils/crontab.c
@@ -20,8 +20,9 @@
20static void edit_file(const struct passwd *pas, const char *file) 20static void edit_file(const struct passwd *pas, const char *file)
21{ 21{
22 const char *ptr; 22 const char *ptr;
23 int pid = xvfork(); 23 pid_t pid;
24 24
25 pid = xvfork();
25 if (pid) { /* parent */ 26 if (pid) { /* parent */
26 wait4pid(pid); 27 wait4pid(pid);
27 return; 28 return;
@@ -30,7 +31,7 @@ static void edit_file(const struct passwd *pas, const char *file)
30 /* CHILD - change user and run editor */ 31 /* CHILD - change user and run editor */
31 /* initgroups, setgid, setuid */ 32 /* initgroups, setgid, setuid */
32 change_identity(pas); 33 change_identity(pas);
33 setup_environment(DEFAULT_SHELL, 34 setup_environment(pas->pw_shell,
34 SETUP_ENV_CHANGEENV | SETUP_ENV_TO_TMP, 35 SETUP_ENV_CHANGEENV | SETUP_ENV_TO_TMP,
35 pas); 36 pas);
36 ptr = getenv("VISUAL"); 37 ptr = getenv("VISUAL");
@@ -41,7 +42,7 @@ static void edit_file(const struct passwd *pas, const char *file)
41 } 42 }
42 43
43 BB_EXECLP(ptr, ptr, file, NULL); 44 BB_EXECLP(ptr, ptr, file, NULL);
44 bb_perror_msg_and_die("exec %s", ptr); 45 bb_perror_msg_and_die("can't execute '%s'", ptr);
45} 46}
46 47
47static int open_as_user(const struct passwd *pas, const char *file) 48static int open_as_user(const struct passwd *pas, const char *file)