summaryrefslogtreecommitdiff
path: root/src/scsi_id/scsi_serial.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-02-13 14:59:56 +0100
committerAnthony G. Basile <blueness@gentoo.org>2014-02-21 10:05:34 -0500
commit4e918b7253bd541a76d3d9641d0be86dd8e132d3 (patch)
tree8839977cdc60aa636d33082a8816e7e934c0bfb4 /src/scsi_id/scsi_serial.c
parent9fa108ac48c9b76111589967184436bf63109731 (diff)
everywhere: always use O_CLOEXEC where it makes sense
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/scsi_id/scsi_serial.c')
-rw-r--r--src/scsi_id/scsi_serial.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/scsi_id/scsi_serial.c b/src/scsi_id/scsi_serial.c
index 2f2afcee6e..378a73d863 100644
--- a/src/scsi_id/scsi_serial.c
+++ b/src/scsi_id/scsi_serial.c
@@ -818,7 +818,7 @@ int scsi_std_inquiry(struct udev *udev,
struct stat statbuf;
int err = 0;
- fd = open(devname, O_RDONLY | O_NONBLOCK);
+ fd = open(devname, O_RDONLY | O_NONBLOCK | O_CLOEXEC);
if (fd < 0) {
log_debug("scsi_id: cannot open %s: %m", devname);
return 1;
@@ -866,7 +866,7 @@ int scsi_get_serial(struct udev *udev,
for (cnt = 20; cnt > 0; cnt--) {
struct timespec duration;
- fd = open(devname, O_RDONLY | O_NONBLOCK);
+ fd = open(devname, O_RDONLY | O_NONBLOCK | O_CLOEXEC);
if (fd >= 0 || errno != EBUSY)
break;
duration.tv_sec = 0;