summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.de.marchi@gmail.com>2013-05-11 00:50:32 -0300
committerLucas De Marchi <lucas.de.marchi@gmail.com>2013-05-11 00:50:32 -0300
commit03f7dfb868b33ee73f2b1e36ab4a1bfa440dcd2c (patch)
treee1e420aedfdaedcebf79f743a88456b3ae623950
parentd7152f6282fe10486d41f7917393e3b86c0e5766 (diff)
downloadkmod-03f7dfb868b33ee73f2b1e36ab4a1bfa440dcd2c.tar.gz
Revert "missing: Don't call syscall() with syscallno == -1"
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.
-rw-r--r--libkmod/missing.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/libkmod/missing.h b/libkmod/missing.h
index b31af84..edb88b9 100644
--- a/libkmod/missing.h
+++ b/libkmod/missing.h
@@ -1,6 +1,5 @@
#pragma once
-#include <errno.h>
#include <unistd.h>
#include <sys/syscall.h>
@@ -16,14 +15,13 @@
# 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