]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
[master]
authorShawn Routhier <sar@isc.org>
Tue, 27 Aug 2013 17:31:27 +0000 (10:31 -0700)
committerShawn Routhier <sar@isc.org>
Tue, 27 Aug 2013 17:31:27 +0000 (10:31 -0700)
Add a sleep call after trying to kill a previous client.  This
should make the "-r" option to the client work more consistently.
[ISC-Bugs: 18175]

RELNOTES
client/dhclient.c

index 86a1cb4d6b1b0d3108ba2bb186bd126e62f7c90f..5cc71506d3c02fe29c123b7acc0cd874442ec08d 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -92,6 +92,11 @@ work on other platforms. Please report any problems and suggested fixes to
   objects.
   [ISC-Bugs #27452]
 
+- Added a sleep call after killing the old client to allow time
+  for the sockets to be cleaned.  This should allow the -r option
+  to work more consistently.
+  [ISC-Bugs #18175]
+
                        Changes since 4.2.4
 
 - Correct code to calculate timing values in client to compare
index cfcf10cd5977505ee72bbaa358a00ff210bfc3b4..aac8084490168fb15cd85a946b1e8f8266a00d65 100644 (file)
@@ -404,8 +404,16 @@ main(int argc, char **argv) {
                        oldpid = (pid_t)temp;
 
                        if (e != 0 && e != EOF) {
-                               if (oldpid)
-                                       kill(oldpid, SIGTERM);
+                               if (oldpid && (kill(oldpid, SIGTERM) == 0)) {
+                                       /*
+                                        * wait for the old process to
+                                        * cleanly terminate.
+                                        * Note kill() with sig=0 could
+                                        * detect termination but only
+                                        * the parent can be signaled...
+                                        */
+                                       sleep(1);
+                               }
                        }
                        fclose(pidfd);
                }