X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=miscutils%2Fmakedevs.c;h=24d07ebe0f3f253fd8b35395aee346bf306dda9e;hb=3a2b103eea9f87fa476b1f8c4ed4a11b7422eab8;hp=0268fbb9dd67afe6e7402f98fc56d033a642330b;hpb=17329745fc31fb23e6647ddf4ed41c0a8a0f90c1;p=oweals%2Fbusybox.git diff --git a/miscutils/makedevs.c b/miscutils/makedevs.c index 0268fbb9d..24d07ebe0 100644 --- a/miscutils/makedevs.c +++ b/miscutils/makedevs.c @@ -1,4 +1,11 @@ /* vi: set sw=4 ts=4: */ +/* + * public domain -- Dave 'Kill a Cop' Cinege + * + * makedevs + * Make ranges of device files quickly. + * known bugs: can't deal with alpha ranges + */ #include #include @@ -12,13 +19,6 @@ #include "busybox.h" #ifdef CONFIG_FEATURE_MAKEDEVS_LEAF -/* - * public domain -- Dave 'Kill a Cop' Cinege - * - * makedevs - * Make ranges of device files quickly. - * known bugs: can't deal with alpha ranges - */ int makedevs_main(int argc, char **argv) { mode_t mode; @@ -77,7 +77,7 @@ int makedevs_main(int argc, char **argv) /* Licensed under the GPL v2 or later, see the file LICENSE in this tarball. */ -extern int makedevs_main(int argc, char **argv) +int makedevs_main(int argc, char **argv) { FILE *table = stdin; char *rootdir = NULL; @@ -94,9 +94,7 @@ extern int makedevs_main(int argc, char **argv) bb_error_msg_and_die("root directory not specified"); } - if (chdir(rootdir) != 0) { - bb_perror_msg_and_die("could not chdir to %s", rootdir); - } + bb_xchdir(rootdir); umask(0); @@ -238,5 +236,5 @@ loop: } #else -# error makdedevs configuration error, either leaf or table must be selected +# error makedevs configuration error, either leaf or table must be selected #endif