]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
missing: Don't call syscall() with syscallno == -1
authorLucas De Marchi <lucas.de.marchi@gmail.com>
Thu, 2 May 2013 16:22:57 +0000 (13:22 -0300)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Thu, 2 May 2013 20:02:52 +0000 (17:02 -0300)
Reported-by: Jean-Francis Roy <jeanfrancis@funtoo.org>
Reported-by: Jan Luebbe <jlu@pengutronix.de>
libkmod/missing.h

index edb88b9fb3b62ee8b393d4b6deded107dcc3fa14..b31af845beed2b3bd744410d49037f60d36a8ff8 100644 (file)
@@ -1,5 +1,6 @@
 #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