projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8dc8ef5
)
libudev: check return value of rename
author
Václav Pavlín
<vpavlin@redhat.com>
Fri, 21 Sep 2012 10:40:29 +0000
(12:40 +0200)
committer
Kay Sievers
<kay@vrfy.org>
Sun, 23 Sep 2012 12:24:43 +0000
(14:24 +0200)
src/libudev/libudev-device-private.c
patch
|
blob
|
history
diff --git
a/src/libudev/libudev-device-private.c
b/src/libudev/libudev-device-private.c
index
00fa3b8
..
489bea8
100644
(file)
--- a/
src/libudev/libudev-device-private.c
+++ b/
src/libudev/libudev-device-private.c
@@
-101,6
+101,7
@@
int udev_device_update_db(struct udev_device *udev_device)
char filename[UTIL_PATH_SIZE];
char filename_tmp[UTIL_PATH_SIZE];
FILE *f;
+ int r;
id = udev_device_get_id_filename(udev_device);
if (id == NULL)
@@
-161,7
+162,9
@@
int udev_device_update_db(struct udev_device *udev_device)
}
fclose(f);
- rename(filename_tmp, filename);
+ r = rename(filename_tmp, filename);
+ if (r < 0)
+ return -1;
udev_dbg(udev, "created %s file '%s' for '%s'\n", has_info ? "db" : "empty",
filename, udev_device_get_devpath(udev_device));
return 0;