Should have thought of this...
authorfredrik@DOLDA2000.COM <fredrik@DOLDA2000.COM@959494ce-11ee-0310-bf91-de5d638817bd>
Fri, 13 May 2005 02:13:20 +0000 (02:13 +0000)
committerfredrik@DOLDA2000.COM <fredrik@DOLDA2000.COM@959494ce-11ee-0310-bf91-de5d638817bd>
Fri, 13 May 2005 02:13:20 +0000 (02:13 +0000)
git-svn-id: svn+ssh://svn.dolda2000.com/srv/svn/repos/src/icmp-dn@235 959494ce-11ee-0310-bf91-de5d638817bd

nss-icmp.c

index 9c32c1c..5bc5ec7 100644 (file)
@@ -32,6 +32,7 @@
 #include <nss.h>
 #include <sys/types.h>
 #include <fcntl.h>
+#include <sys/wait.h>
 
 #define CONFIGFILE "/etc/nss-icmp.conf"
 #if 0
@@ -217,6 +218,7 @@ enum nss_status _nss_icmp_gethostbyaddr_r(const void *addr, socklen_t len, int a
     pid_t child;
     int pfd[2];
     int rl;
+    int status;
     struct cache *cc;
     
     if(!inited) {
@@ -310,6 +312,8 @@ enum nss_status _nss_icmp_gethostbyaddr_r(const void *addr, socklen_t len, int a
        addrbuf[rl] = 0;
        close(pfd[0]);
        
+       waitpid(child, &status, 0);
+       
        if((p = strchr(addrbuf, '\n')) == NULL) {
            if(usecache)
                cachenotfound(addr, len, af, nfttl);