mirror of
https://github.com/troglobit/finit.git
synced 2026-11-07 16:01:08 +00:00
touch(): Check return value of mknod(), report error if errno != EEXIST.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
1bdcef9a2c
commit
5ff7994852
1 file changed
+1
-1
@@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#ifndef touch
|
#ifndef touch
|
||||||
# define touch(x) mknod((x), S_IFREG|0644, 0)
|
# define touch(x) do { if (mknod((x), S_IFREG|0644, 0) && errno != EEXIST) _pe("Failed creating %s", x); } while (0)
|
||||||
#endif
|
#endif
|
||||||
#ifndef chardev
|
#ifndef chardev
|
||||||
# define chardev(x,m,maj,min) mknod((x), S_IFCHR|(m), makedev((maj),(min)))
|
# define chardev(x,m,maj,min) mknod((x), S_IFCHR|(m), makedev((maj),(min)))
|
||||||
|
|||||||
Reference in new issue
Block a user