use cloexec wrappers wherever applicable

This commit is contained in:
Lennart Poettering 2009-10-30 03:32:38 +01:00
parent 9c1a98953f
commit 65e7bc18a9
25 changed files with 39 additions and 91 deletions

View file

@ -62,11 +62,7 @@ static int random_proper(void *ret_data, size_t length) {
while (*device) {
ret = 0;
if ((fd = open(*device, O_RDONLY
#ifdef O_NOCTTY
| O_NOCTTY
#endif
)) >= 0) {
if ((fd = pa_open_cloexec(*device, O_RDONLY, 0)) >= 0) {
if ((r = pa_loop_read(fd, ret_data, length, NULL)) < 0 || (size_t) r != length)
ret = -1;