diff options
author | John Crispin <blogic@openwrt.org> | 2013-07-03 19:16:09 +0200 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2013-07-03 20:28:03 +0200 |
commit | 4ec2545ed6a0626715802a1c7919fe0e38436301 (patch) | |
tree | 218bd1e65c597ee92fc57ab8f6cc73385d367935 /mkdev.c | |
parent | a2953547e345eb6dd4e48474ca1e48082d3d564f (diff) | |
download | unitd-4ec2545ed6a0626715802a1c7919fe0e38436301.tar unitd-4ec2545ed6a0626715802a1c7919fe0e38436301.zip |
properly fix umask handling
https://dev.openwrt.org/ticket/13752
https://dev.openwrt.org/ticket/13794
Signed-off-by: John Crispin <blogic@openwrt.org>
Diffstat (limited to 'mkdev.c')
-rw-r--r-- | mkdev.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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) |