aboutsummaryrefslogtreecommitdiff
path: root/miscutils/makedevs.c
diff options
context:
space:
mode:
authoraldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-04-12 18:39:58 +0000
committeraldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-04-12 18:39:58 +0000
commit173133414753125e4a5ddf160cd22807a703bd38 (patch)
treec7e395cfe1eafcd601bc16e0231fc30f8789e4d9 /miscutils/makedevs.c
parent04f8875fd522ea63205b3e223d56979117245d1f (diff)
downloadbusybox-w32-173133414753125e4a5ddf160cd22807a703bd38.tar.gz
busybox-w32-173133414753125e4a5ddf160cd22807a703bd38.tar.bz2
busybox-w32-173133414753125e4a5ddf160cd22807a703bd38.zip
- patch from Denis Vlasenko to add and use bb_xchdir()
git-svn-id: svn://busybox.net/trunk/busybox@14837 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'miscutils/makedevs.c')
-rw-r--r--miscutils/makedevs.c18
1 files changed, 8 insertions, 10 deletions
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 */
22int makedevs_main(int argc, char **argv) 22int 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