Replace stime to clock_settime sandbox/playchang/glibc_236
authorwchang kim <wchang.kim@samsung.com>
Tue, 30 May 2023 00:00:25 +0000 (09:00 +0900)
committerwchang kim <wchang.kim@samsung.com>
Tue, 30 May 2023 00:00:25 +0000 (09:00 +0900)
tests/test-client.cpp

index f01aa5c50a64cea46b2c122e6fd1bd5f5bb314a2..1fae932640756f32a4243995e99fc11e10f97c2c 100644 (file)
@@ -24,6 +24,7 @@
 #include <klay/testbench.h>
 
 #include "test-util.h"
+#include <time.h>
 
 #include <auth-passwd.h>
 #include <auth-passwd-admin.h> /* for init/deinit */
@@ -91,7 +92,10 @@ int set_relative_date(int days)
        time_t as_is = ::time(NULL);
        time_t to_be = as_is + (days * 86400);
 
-       return ::stime(&to_be);
+    timespec ts = {};
+    ts.tv_sec = to_be;
+
+       return clock_settime(CLOCK_REALTIME, &ts);
 }
 } // anonymous namespace