[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[dm-devel] [PATCH] umask in device node creation error handling



Hi,

I guess that the diff is pretty much self-explaining ...

diff --git a/libdm/libdm-common.c b/libdm/libdm-common.c
index b7782a7..554c1a4 100644
--- a/libdm/libdm-common.c
+++ b/libdm/libdm-common.c
@@ -360,6 +360,7 @@ static int _add_dev_node(const char *dev_name, uint32_t major, uint32_t minor,
 
 	old_mask = umask(0);
 	if (mknod(path, S_IFBLK | mode, dev) < 0) {
+		umask(old_mask);
 		log_error("Unable to make device node for '%s'", dev_name);
 		return 0;
 	}

Florian


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]