i = 0;
if (except_fd >= 0) {
+ int fd;
p[i++] = except_fd;
- while ((p[i++] = va_arg(ap, int)) >= 0)
- ;
+ while ((fd = va_arg(ap, int)) >= 0)
+ p[i++] = fd;
}
p[i] = -1;
struct dirent *de;
while ((de = readdir(d))) {
+ pa_bool_t found;
long l;
char *e = NULL;
int i;
return -1;
}
- if (fd <= 3)
+ if (fd < 3)
continue;
if (fd == dirfd(d))
continue;
+ found = FALSE;
for (i = 0; except_fds[i] >= 0; i++)
- if (except_fds[i] == fd)
- continue;
+ if (except_fds[i] == fd) {
+ found = TRUE;
+ break;
+ }
- if (close(fd) < 0) {
+ if (found)
+ continue;
+
+ if (pa_close(fd) < 0) {
saved_errno = errno;
closedir(d);
errno = saved_errno;
i = 0;
if (except >= 1) {
+ int sig;
p[i++] = except;
- while ((p[i++] = va_arg(ap, int)) >= 0)
- ;
+ while ((sig = va_arg(ap, int)) >= 0)
+ p[i++] = sig;
}
p[i] = -1;
int sig;
for (sig = 1; sig < _NSIG; sig++) {
- int reset = 1;
+ pa_bool_t reset = TRUE;
switch (sig) {
case SIGKILL:
case SIGSTOP:
- reset = 0;
+ reset = FALSE;
break;
default: {
for (i = 0; except[i] > 0; i++) {
if (sig == except[i]) {
- reset = 0;
+ reset = FALSE;
break;
}
}