summaryrefslogtreecommitdiff
path: root/server-tools
diff options
context:
space:
mode:
Diffstat (limited to 'server-tools')
-rw-r--r--server-tools/instance-manager/guardian.cc5
-rw-r--r--server-tools/instance-manager/instance.cc5
2 files changed, 4 insertions, 6 deletions
diff --git a/server-tools/instance-manager/guardian.cc b/server-tools/instance-manager/guardian.cc
index c4bcc2b6f51..cc3ff06256f 100644
--- a/server-tools/instance-manager/guardian.cc
+++ b/server-tools/instance-manager/guardian.cc
@@ -227,9 +227,8 @@ void Guardian_thread::run()
node= node->next;
}
- timeout.tv_sec= time(NULL) + monitoring_interval;
- timeout.tv_nsec= 0;
-
+ set_timespec(timeout, monitoring_interval);
+
/* check the loop predicate before sleeping */
if (!(shutdown_requested && (!(guarded_instances))))
thread_registry.cond_timedwait(&thread_info, &COND_guardian,
diff --git a/server-tools/instance-manager/instance.cc b/server-tools/instance-manager/instance.cc
index 7633d4da4d2..58fe7569db7 100644
--- a/server-tools/instance-manager/instance.cc
+++ b/server-tools/instance-manager/instance.cc
@@ -475,10 +475,9 @@ int Instance::stop()
waitchild= options.shutdown_delay_val;
kill_instance(SIGTERM);
- /* sleep on condition to wait for SIGCHLD */
- timeout.tv_sec= time(NULL) + waitchild;
- timeout.tv_nsec= 0;
+ /* sleep on condition to wait for SIGCHLD */
+ set_timespec(timeout, waitchild);
if (pthread_mutex_lock(&LOCK_instance))
return ER_STOP_INSTANCE;