fix closing of fds in gconf module

git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1616 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Lennart Poettering 2007-08-10 14:49:26 +00:00
parent ffa1708070
commit 357c0e415f

View file

@ -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);
}