summaryrefslogtreecommitdiff
path: root/src/udev
diff options
context:
space:
mode:
authorlhb-jr <lhb.jr@gmx.com>2014-03-21 11:55:36 -0400
committerlhb-jr <lhb.jr@gmx.com>2014-03-21 11:55:36 -0400
commit728baddb472075e21421ebdc5de0a6e992453fbc (patch)
tree5b40ec262cb7dc5953ae761ef00f46eca72d641a /src/udev
parentc0acbd0656ae0aeaa53f1d291fdee385ea43f7ff (diff)
fixed gcc warnings that call returns not checked
modified: src/collect/collect.c modified: src/udev/udev-node.c modified: src/udev/udevadm-settle.c modified: src/udev/udevd.c
Diffstat (limited to 'src/udev')
-rw-r--r--src/udev/udev-node.c9
-rw-r--r--src/udev/udevadm-settle.c5
-rw-r--r--src/udev/udevd.c5
3 files changed, 15 insertions, 4 deletions
diff --git a/src/udev/udev-node.c b/src/udev/udev-node.c
index 200e24fb41..2dddc7b4b4 100644
--- a/src/udev/udev-node.c
+++ b/src/udev/udev-node.c
@@ -286,8 +286,13 @@ static int node_permissions_apply(struct udev_device *dev, bool apply,
if ((stats.st_mode & 0777) != (mode & 0777) || stats.st_uid != uid || stats.st_gid != gid) {
log_debug("set permissions %s, %#o, uid=%u, gid=%u", devnode, mode, uid, gid);
- chmod(devnode, mode);
- chown(devnode, uid, gid);
+ ;
+ if((chmod(devnode, mode) !=0 ) || (chown(devnode, uid,gid) !=0)) {
+ err = -errno;
+ log_error("FAILED to set permissions %s, %#o, uid=%u, gid=%u"
+ ,devnode, mode, uid, gid);
+ goto out;
+ }
} else {
log_debug("preserve permissions %s, %#o, uid=%u, gid=%u", devnode, mode, uid, gid);
}
diff --git a/src/udev/udevadm-settle.c b/src/udev/udevadm-settle.c
index 9eeeab8f14..9ae6c6bf8e 100644
--- a/src/udev/udevadm-settle.c
+++ b/src/udev/udevadm-settle.c
@@ -201,7 +201,10 @@ static int adm_settle(struct udev *udev, int argc, char *argv[])
if (poll(pfd, 1, delay) > 0 && pfd[0].revents & POLLIN) {
char buf[sizeof(struct inotify_event) + PATH_MAX];
- read(pfd[0].fd, buf, sizeof(buf));
+ if(read(pfd[0].fd, buf, sizeof(buf)) < 0){
+ log_error("failed to read /run/udev");
+ goto out;
+ }
}
} else {
sleep(1);
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index 850e4f5ef6..03de852c02 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -1031,7 +1031,10 @@ int main(int argc, char *argv[])
}
/* set umask before creating any file/directory */
- chdir("/");
+ if(chdir("/")!= 0) {
+ log_error("unable to change into directory '/'");
+ goto exit;
+ }
umask(022);
mkdir("/run/udev", 0755);