From 357c0e415f027aaa306d9918bee8d7410ef91054 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 10 Aug 2007 14:49:26 +0000 Subject: fix closing of fds in gconf module git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1616 fefdeb5f-60dc-0310-8127-8f9354f1896f --- src/modules/gconf/module-gconf.c | 9 ++++++--- 1 file 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); } -- cgit