summaryrefslogtreecommitdiffstats
path: root/mkdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'mkdev.c')
-rw-r--r--mkdev.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/mkdev.c b/mkdev.c
index d507939..0f55554 100644
--- a/mkdev.c
+++ b/mkdev.c
@@ -47,12 +47,15 @@ static bool find_pattern(const char *name)
static void make_dev(const char *path, bool block, int major, int minor)
{
+ unsigned int oldumask = umask(0);
unsigned int _mode = mode | (block ? S_IFBLK : S_IFCHR);
+
DEBUG(2, "Creating %s device %s(%d,%d)\n",
block ? "block" : "character",
path, major, minor);
mknod(path, _mode, makedev(major, minor));
+ umask(oldumask);
}
static void find_devs(bool block)