aboutsummaryrefslogtreecommitdiff
path: root/testcases/kernel
diff options
context:
space:
mode:
authorXiao Yang <yangx.jy@cn.fujitsu.com>2019-04-05 17:12:50 +0800
committerXiao Yang <yangx.jy@cn.fujitsu.com>2019-04-08 09:45:36 +0800
commit66c59e9d2df68436cf0dbb441a27835823d96d56 (patch)
tree1907af0e4f1d0d3c7f0b059a4f9d6e2f62ed1f43 /testcases/kernel
parent8fd49cebd5d172672f8e1cdc21536c8602cd58f2 (diff)
syscalls/stime: Add libc stime() detection
Don't alway skip libc stime() for Android because bionic(Android libc) may implement it in the future. Also add break to fix potential compiler warnings. Reviewed-by: Petr Vorel <pvorel@suse.cz> Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Diffstat (limited to 'testcases/kernel')
-rw-r--r--testcases/kernel/syscalls/stime/stime_var.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/testcases/kernel/syscalls/stime/stime_var.h b/testcases/kernel/syscalls/stime/stime_var.h
index b014f0a10..b33c5704e 100644
--- a/testcases/kernel/syscalls/stime/stime_var.h
+++ b/testcases/kernel/syscalls/stime/stime_var.h
@@ -8,6 +8,7 @@
#define STIME_VAR__
#include <sys/time.h>
+#include "config.h"
#include "lapi/syscalls.h"
#define TEST_VARIANTS 3
@@ -16,11 +17,12 @@ static int do_stime(time_t *ntime)
{
switch (tst_variant) {
case 0:
-#ifdef __ANDROID__
- tst_brk(TCONF, "libc stime() is not implemented on Android");
+#ifndef HAVE_STIME
+ tst_brk(TCONF, "libc stime() is not implemented");
#else
return stime(ntime);
#endif
+ break;
case 1:
return tst_syscall(__NR_stime, ntime);
case 2: {
@@ -41,13 +43,13 @@ static void stime_info(void)
switch (tst_variant) {
case 0:
tst_res(TINFO, "Testing libc stime()");
- break;
+ break;
case 1:
tst_res(TINFO, "Testing SYS_stime syscall");
- break;
+ break;
case 2:
tst_res(TINFO, "Testing SYS_settimeofday syscall");
- break;
+ break;
}
}