Revert "missing: Don't call syscall() with syscallno == -1"
authorLucas De Marchi <lucas.de.marchi@gmail.com>
Sat, 11 May 2013 03:50:32 +0000 (00:50 -0300)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Sat, 11 May 2013 03:50:32 +0000 (00:50 -0300)
This reverts commit 38829712e5c411bc250aeae142fc6bf06e794d58.  It fixes
the problem, but it breaks the testsuite for those who don't have
__NR_finit_module. The testsuite would have to make the same check.

Instead, I'm reverting this change and I'm going to apply another patch
from Jan Luebbe who got this right from the beginning.

libkmod/missing.h

index b31af84..edb88b9 100644 (file)
@@ -1,6 +1,5 @@
 #pragma once
 
-#include <errno.h>
 #include <unistd.h>
 #include <sys/syscall.h>
 
 # define MODULE_INIT_IGNORE_VERMAGIC 2
 #endif
 
+#ifndef __NR_finit_module
+# define __NR_finit_module -1
+#endif
+
 #ifndef HAVE_FINIT_MODULE
 static inline int finit_module(int fd, const char *uargs, int flags)
 {
-#ifndef __NR_finit_module
-       errno = ENOSYS;
-       return -1;
-#else
        return syscall(__NR_finit_module, fd, uargs, flags);
-#endif
 }
 #endif