projects
/
qemu-gpiodev
/
libgpiod.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
da93a3b
)
core: close GPIO chip device files on exec
author
Bartosz Golaszewski
<bartekgola@gmail.com>
Mon, 6 Feb 2017 09:59:00 +0000
(10:59 +0100)
committer
Bartosz Golaszewski
<bartekgola@gmail.com>
Mon, 6 Feb 2017 09:59:00 +0000
(10:59 +0100)
Pass the O_CLOEXEC flag to open() so that we don't leak open GPIO
chip descriptors to any processes spawned by users of the library.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
src/lib/core.c
patch
|
blob
|
history
diff --git
a/src/lib/core.c
b/src/lib/core.c
index 71ac7d23bcb3cecd39395f6e52f49a30bbc938a5..f5beeb769ab7062db64e5fd217c282d8de3ca034 100644
(file)
--- a/
src/lib/core.c
+++ b/
src/lib/core.c
@@
-899,7
+899,7
@@
struct gpiod_chip * gpiod_chip_open(const char *path)
struct gpiod_chip *chip;
int status, fd;
- fd = open(path, O_RDWR);
+ fd = open(path, O_RDWR
| O_CLOEXEC
);
if (fd < 0) {
last_error_from_errno();
return NULL;