Package: dibbler-client Version: 0.7.3-1.3 Tags: patch, upstream Hello,
dibbler-client calls resolvconf if it is available for
updating DNS information. However, it does not wait() for the
child process, so it leaves Zombies on the way.
The following patch implements one way to avoid this effect by
double fork()ing and letting init taking care the the resolvconf
process.
Bye,
Joerg
--- dibbler-0.7.3/Port-linux/lowlevel-options-linux.c 2011-05-19
16:16:34.000000000 +0200
+++ dd-patched/Port-linux/lowlevel-options-linux.c 2011-05-19
15:59:53.000000000 +0200
@@ -37,19 +37,23 @@
*/
FILE *resolvconf_open(const char *arg1, const char *arg2)
{
+ pid_t child;
int pipefd[2];
if (access(RESOLVCONF, X_OK) != 0)
return NULL;
if (pipe(pipefd) != 0)
return NULL;
- switch(fork()) {
+ switch(child=fork()) {
case 0: /* child */
close(pipefd[1]);
close(0);
dup(pipefd[0]);
close(pipefd[0]);
- execl(RESOLVCONF, RESOLVCONF, arg1, arg2, (char *)NULL);
+ /* double fork so init reaps the child */
+ if (!fork()) { /* child */
+ execl(RESOLVCONF, RESOLVCONF, arg1, arg2, (char *)NULL);
+ } /* All other cases are meaningless here */
exit(-1);
break;
case -1: /* error */
@@ -58,6 +62,7 @@
}
/* parent */
close(pipefd[0]);
+ waitpid(child, NULL, 0);
return fdopen(pipefd[1], "w");
}
signature.asc
Description: Digital signature

