/* vi: set sw=4 ts=4: */
+/*
+ * public domain -- Dave 'Kill a Cop' Cinege <dcinege@psychosis.com>
+ *
+ * makedevs
+ * Make ranges of device files quickly.
+ * known bugs: can't deal with alpha ranges
+ */
#include <stdio.h>
#include <stdlib.h>
#include "busybox.h"
#ifdef CONFIG_FEATURE_MAKEDEVS_LEAF
-/*
- * public domain -- Dave 'Kill a Cop' Cinege <dcinege@psychosis.com>
- *
- * 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;
/* 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;
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);
}
#else
-# error makdedevs configuration error, either leaf or table must be selected
+# error makedevs configuration error, either leaf or table must be selected
#endif