995519a0fc
See: http://bugs.funtoo.org/browse/FL-534 Thanks Funtoo!
41 lines
946 B
Diff
41 lines
946 B
Diff
From 38829712e5c411bc250aeae142fc6bf06e794d58 Mon Sep 17 00:00:00 2001
|
|
From: Lucas De Marchi <lucas.de.marchi@gmail.com>
|
|
Date: Thu, 02 May 2013 16:22:57 +0000
|
|
Subject: missing: Don't call syscall() with syscallno == -1
|
|
|
|
Reported-by: Jean-Francis Roy <jeanfrancis@funtoo.org>
|
|
Reported-by: Jan Luebbe <jlu@pengutronix.de>
|
|
---
|
|
diff --git a/libkmod/missing.h b/libkmod/missing.h
|
|
index edb88b9..b31af84 100644
|
|
--- a/libkmod/missing.h
|
|
+++ b/libkmod/missing.h
|
|
@@ -1,5 +1,6 @@
|
|
#pragma once
|
|
|
|
+#include <errno.h>
|
|
#include <unistd.h>
|
|
#include <sys/syscall.h>
|
|
|
|
@@ -15,13 +16,14 @@
|
|
# 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
|
|
--
|
|
cgit v0.9.1
|