]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
[v4_1_esv]
authorShawn Routhier <sar@isc.org>
Tue, 27 Aug 2013 17:41:54 +0000 (10:41 -0700)
committerShawn Routhier <sar@isc.org>
Tue, 27 Aug 2013 17:41:54 +0000 (10:41 -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 beee5f55f3f72b1853bc95d80db715c9701ca99a..141445873f6686b1f105eac6cb1ece38a5d42a57 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -80,6 +80,11 @@ work on other platforms. Please report any problems and suggested fixes to
   for the patch.
   [ISC-Bugs #33351]
 
+- 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.1-ESV-R8rc1
 
 - None
index b0cce3d953d24a1219a91573723290b5d6064945..7297be55a2d96c886fc1bac166abd8ad446fcef5 100644 (file)
@@ -395,8 +395,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);
                }