Should have thought of this...
[icmp-dn.git] / 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);