diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2010-05-14 14:52:18 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2010-05-14 14:52:18 +0200 |
commit | 0c5c48040ac0f4c97f73fb3ac5493cc2d84a963b (patch) | |
tree | 314ce681dab98eedf25f7b12c87a0e0575143bca /libudev/libudev-device.c | |
parent | 12d73e9587a8d9a3ab6415183e4e6762315aa85a (diff) |
libudev: add O_CLOEXEC
Diffstat (limited to 'libudev/libudev-device.c')
-rw-r--r-- | libudev/libudev-device.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libudev/libudev-device.c b/libudev/libudev-device.c index 7e6b7f1ce7..5811490a34 100644 --- a/libudev/libudev-device.c +++ b/libudev/libudev-device.c @@ -279,7 +279,7 @@ int udev_device_read_db(struct udev_device *udev_device) return 0; } - f = fopen(filename, "r"); + f = fopen(filename, "re"); if (f == NULL) { dbg(udev_device->udev, "error reading db file %s: %m\n", filename); return -1; @@ -339,7 +339,7 @@ int udev_device_read_uevent_file(struct udev_device *udev_device) return 0; util_strscpyl(filename, sizeof(filename), udev_device->syspath, "/uevent", NULL); - f = fopen(filename, "r"); + f = fopen(filename, "re"); if (f == NULL) return -1; udev_device->uevent_loaded = true; @@ -1164,7 +1164,7 @@ const char *udev_device_get_sysattr_value(struct udev_device *udev_device, const goto out; /* read attribute value */ - fd = open(path, O_RDONLY); + fd = open(path, O_RDONLY|O_CLOEXEC); if (fd < 0) { dbg(udev_device->udev, "attribute '%s' can not be opened\n", path); goto out; |