diff options
Diffstat (limited to 'miscutils')
-rw-r--r-- | miscutils/crond.c | 4 | ||||
-rw-r--r-- | miscutils/crontab.c | 9 | ||||
-rw-r--r-- | miscutils/makedevs.c | 18 |
3 files changed, 12 insertions, 19 deletions
diff --git a/miscutils/crond.c b/miscutils/crond.c index 06b8769fa..4d479bc0d 100644 --- a/miscutils/crond.c +++ b/miscutils/crond.c | |||
@@ -197,9 +197,7 @@ int crond_main(int ac, char **av) | |||
197 | * change directory | 197 | * change directory |
198 | */ | 198 | */ |
199 | 199 | ||
200 | if (chdir(CDir) != 0) { | 200 | bb_xchdir(CDir); |
201 | bb_perror_msg_and_die("%s", CDir); | ||
202 | } | ||
203 | signal(SIGHUP, SIG_IGN); /* hmm.. but, if kill -HUP original | 201 | signal(SIGHUP, SIG_IGN); /* hmm.. but, if kill -HUP original |
204 | * version - his died. ;( | 202 | * version - his died. ;( |
205 | */ | 203 | */ |
diff --git a/miscutils/crontab.c b/miscutils/crontab.c index df94c855a..703d01ecc 100644 --- a/miscutils/crontab.c +++ b/miscutils/crontab.c | |||
@@ -1,3 +1,4 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | ||
1 | /* | 2 | /* |
2 | * CRONTAB | 3 | * CRONTAB |
3 | * | 4 | * |
@@ -148,8 +149,7 @@ crontab_main(int ac, char **av) | |||
148 | * Change directory to our crontab directory | 149 | * Change directory to our crontab directory |
149 | */ | 150 | */ |
150 | 151 | ||
151 | if (chdir(CDir) < 0) | 152 | bb_xchdir(CDir); |
152 | bb_perror_msg_and_die("cannot change dir to %s", CDir); | ||
153 | 153 | ||
154 | /* | 154 | /* |
155 | * Handle options as appropriate | 155 | * Handle options as appropriate |
@@ -358,10 +358,7 @@ ChangeUser(const char *user, short dochdir) | |||
358 | if (dochdir) { | 358 | if (dochdir) { |
359 | if (chdir(pas->pw_dir) < 0) { | 359 | if (chdir(pas->pw_dir) < 0) { |
360 | bb_perror_msg("chdir failed: %s %s", user, pas->pw_dir); | 360 | bb_perror_msg("chdir failed: %s %s", user, pas->pw_dir); |
361 | if (chdir(TMPDIR) < 0) { | 361 | bb_xchdir(TMPDIR); |
362 | bb_perror_msg_and_die("chdir failed: %s %s", user, TMPDIR); | ||
363 | return(-1); | ||
364 | } | ||
365 | } | 362 | } |
366 | } | 363 | } |
367 | return(pas->pw_uid); | 364 | return(pas->pw_uid); |
diff --git a/miscutils/makedevs.c b/miscutils/makedevs.c index 999b99331..24d07ebe0 100644 --- a/miscutils/makedevs.c +++ b/miscutils/makedevs.c | |||
@@ -1,4 +1,11 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | 1 | /* vi: set sw=4 ts=4: */ |
2 | /* | ||
3 | * public domain -- Dave 'Kill a Cop' Cinege <dcinege@psychosis.com> | ||
4 | * | ||
5 | * makedevs | ||
6 | * Make ranges of device files quickly. | ||
7 | * known bugs: can't deal with alpha ranges | ||
8 | */ | ||
2 | 9 | ||
3 | #include <stdio.h> | 10 | #include <stdio.h> |
4 | #include <stdlib.h> | 11 | #include <stdlib.h> |
@@ -12,13 +19,6 @@ | |||
12 | #include "busybox.h" | 19 | #include "busybox.h" |
13 | 20 | ||
14 | #ifdef CONFIG_FEATURE_MAKEDEVS_LEAF | 21 | #ifdef CONFIG_FEATURE_MAKEDEVS_LEAF |
15 | /* | ||
16 | * public domain -- Dave 'Kill a Cop' Cinege <dcinege@psychosis.com> | ||
17 | * | ||
18 | * makedevs | ||
19 | * Make ranges of device files quickly. | ||
20 | * known bugs: can't deal with alpha ranges | ||
21 | */ | ||
22 | int makedevs_main(int argc, char **argv) | 22 | int makedevs_main(int argc, char **argv) |
23 | { | 23 | { |
24 | mode_t mode; | 24 | mode_t mode; |
@@ -94,9 +94,7 @@ int makedevs_main(int argc, char **argv) | |||
94 | bb_error_msg_and_die("root directory not specified"); | 94 | bb_error_msg_and_die("root directory not specified"); |
95 | } | 95 | } |
96 | 96 | ||
97 | if (chdir(rootdir) != 0) { | 97 | bb_xchdir(rootdir); |
98 | bb_perror_msg_and_die("could not chdir to %s", rootdir); | ||
99 | } | ||
100 | 98 | ||
101 | umask(0); | 99 | umask(0); |
102 | 100 | ||