Changeset: c786801bc515 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c786801bc515
Modified Files:
        tools/merovingian/daemon/argvcmds.c
Branch: Jun2016
Log Message:

Don't lie: wait up to 5 seconds before killing.


diffs (26 lines):

diff --git a/tools/merovingian/daemon/argvcmds.c 
b/tools/merovingian/daemon/argvcmds.c
--- a/tools/merovingian/daemon/argvcmds.c
+++ b/tools/merovingian/daemon/argvcmds.c
@@ -504,15 +504,16 @@ command_stop(confkeyval *ckv, int argc, 
        /* wait up to 5 seconds for monetdbd to actually stop */
        for (i = 0; i < 10; i++) {
                tv.tv_sec = 0;
-               tv.tv_usec = 500;
+               tv.tv_usec = 500000;
                select(0, NULL, NULL, NULL, &tv);
-               if (kill(daemon, 0) == -1)
-                       break;
-               if (i == 9) {
-                       /* done waiting, use harsher measures */
-                       kill(daemon, SIGKILL);
+               if (kill(daemon, 0) == -1) {
+                       /* daemon has died */
+                       return(0);
                }
        }
 
+       /* done waiting, use harsher measures */
+       kill(daemon, SIGKILL);
+
        return(0);
 }
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to