chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
80d39fb
)
udev: log error if chmod/chown of static dev nodes fails
author
Tom Gundersen
<teg@jklm.no>
Wed, 24 Jul 2013 12:55:19 +0000
(14:55 +0200)
committer
Tom Gundersen
<teg@jklm.no>
Wed, 24 Jul 2013 13:13:00 +0000
(15:13 +0200)
src/udev/udev-rules.c
patch
|
blob
|
history
diff --git
a/src/udev/udev-rules.c
b/src/udev/udev-rules.c
index 8ace7050dbdf49432d4524bae049582d66877ef2..fe4965feb9f38ee1301a6c3facf3773c7b25a2f4 100644
(file)
--- a/
src/udev/udev-rules.c
+++ b/
src/udev/udev-rules.c
@@
-2593,13
+2593,21
@@
int udev_rules_apply_static_dev_perms(struct udev_rules *rules)
mode = 0600;
}
if (mode != (stats.st_mode & 01777)) {
mode = 0600;
}
if (mode != (stats.st_mode & 01777)) {
- chmod(device_node, mode);
- log_debug("chmod '%s' %#o\n", device_node, mode);
+ r = chmod(device_node, mode);
+ if (r < 0) {
+ log_error("failed to chmod '%s' %#o\n", device_node, mode);
+ return -errno;
+ } else
+ log_debug("chmod '%s' %#o\n", device_node, mode);
}
if ((uid != 0 && uid != stats.st_uid) || (gid != 0 && gid != stats.st_gid)) {
}
if ((uid != 0 && uid != stats.st_uid) || (gid != 0 && gid != stats.st_gid)) {
- chown(device_node, uid, gid);
- log_debug("chown '%s' %u %u\n", device_node, uid, gid);
+ r = chown(device_node, uid, gid);
+ if (r < 0) {
+ log_error("failed to chown '%s' %u %u \n", device_node, uid, gid);
+ return -errno;
+ } else
+ log_debug("chown '%s' %u %u\n", device_node, uid, gid);
}
utimensat(AT_FDCWD, device_node, NULL, 0);
}
utimensat(AT_FDCWD, device_node, NULL, 0);