diff options
author | Lennart Poettering <lennart@poettering.net> | 2007-08-10 14:49:26 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2007-08-10 14:49:26 +0000 |
commit | 357c0e415f027aaa306d9918bee8d7410ef91054 (patch) | |
tree | 41b1d7272d74c56c5609791313953bb9bb0a4229 | |
parent | ffa170807086e959ce7cd9b21fb0c29b104b222b (diff) |
fix closing of fds in gconf module
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1616 fefdeb5f-60dc-0310-8127-8f9354f1896f
-rw-r--r-- | src/modules/gconf/module-gconf.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/modules/gconf/module-gconf.c b/src/modules/gconf/module-gconf.c index 7e932c11..24f60b1e 100644 --- a/src/modules/gconf/module-gconf.c +++ b/src/modules/gconf/module-gconf.c @@ -381,14 +381,17 @@ static int start_client(const char *n, pid_t *pid) { struct dirent *de; while ((de = readdir(d))) { - char *e; + char *e = NULL; int fd; + + if (de->d_name[0] == '.') + continue; errno = 0; fd = strtol(de->d_name, &e, 10); - pa_assert(errno == 0 && *e == 0); + pa_assert(errno == 0 && e && *e == 0); - if (fd >= 3) + if (fd >= 3 && dirfd(d) != fd) close(fd); } |