diff options
author | Adam Jackson <ajax@redhat.com> | 2012-02-27 11:19:50 -0500 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2012-02-27 17:09:01 -0500 |
commit | d2dc9f9daa45504f035b169aba94d0b154fd29f0 (patch) | |
tree | 28ccca7fd1ab27a208a9fbd73306c922d19dac86 /src/x86_pci.c | |
parent | f550c1347d3518874fe1c1d417a57322ee6b52db (diff) | |
download | libpciaccess-d2dc9f9daa45504f035b169aba94d0b154fd29f0.tar.gz |
Use O_CLOEXEC for internal file descriptors
Well, almost all of them. zlib doesn't support "e" in the mode string
in gzopen() though it will silently accept and ignore it, and Solaris appears
not to support "e" in the mode string at all.
Signed-off-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'src/x86_pci.c')
-rw-r--r-- | src/x86_pci.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/x86_pci.c b/src/x86_pci.c index c42d3e0..78e5f6c 100644 --- a/src/x86_pci.c +++ b/src/x86_pci.c @@ -330,7 +330,7 @@ pci_device_x86_read_rom(struct pci_device *dev, void *buffer) return ENOSYS; } - memfd = open("/dev/mem", O_RDONLY); + memfd = open("/dev/mem", O_RDONLY | O_CLOEXEC); if (memfd == -1) return errno; @@ -475,7 +475,7 @@ static int pci_device_x86_map_range(struct pci_device *dev, struct pci_device_mapping *map) { - int memfd = open("/dev/mem", O_RDWR); + int memfd = open("/dev/mem", O_RDWR | O_CLOEXEC); int prot = PROT_READ; if (memfd == -1) |