From 8e00db9537fee379d900b352b4f6750c52d17726 Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Tue, 9 Apr 2013 11:54:05 -0300 Subject: testsuite: Fix checking __sysno Use an if instead of a case statemente. If __NR_finit_module is not defined in system headers we define it to -1, causing a "duplicate case value" error. Yet, we don't want to actually call our finit_module() function if -1 is passed. This also fix errno being set with negative value. --- testsuite/init_module.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'testsuite') diff --git a/testsuite/init_module.c b/testsuite/init_module.c index f1e7f82..dad66e5 100644 --- a/testsuite/init_module.c +++ b/testsuite/init_module.c @@ -309,11 +309,12 @@ TS_EXPORT long int syscall(long int __sysno, ...) va_list ap; long ret; - switch (__sysno) { - case -1: - errno = -ENOSYS; + if (__sysno == -1) { + errno = ENOSYS; return -1; - case __NR_finit_module: { + } + + if (__sysno == __NR_finit_module) { const char *args; int flags; int fd; @@ -329,7 +330,6 @@ TS_EXPORT long int syscall(long int __sysno, ...) va_end(ap); return ret; } - } /* * FIXME: no way to call the libc function - let's hope there are no -- cgit v1.2.1