diff options
author | Jan Luebbe <jlu@pengutronix.de> | 2013-05-02 22:05:15 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2013-05-03 18:56:43 +0200 |
commit | bd0fb8e7429d96c3d54845ca21f8bbc4b03da9ed (patch) | |
tree | b8915babb8db7458c68d15117205b35488f548b2 | |
parent | c9a35bdca68ad7f8cfcd723a8f4fed6ae929b973 (diff) | |
download | ptxdist-bd0fb8e7429d96c3d54845ca21f8bbc4b03da9ed.tar.gz ptxdist-bd0fb8e7429d96c3d54845ca21f8bbc4b03da9ed.tar.xz |
libkmod: avoid calling syscall() with -1
This fixes an illegal instruction error on qemu ARM.
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r-- | patches/kmod-13/0001-missing-Don-t-call-syscall-with-syscallno-1.patch | 40 | ||||
-rw-r--r-- | patches/kmod-13/series | 4 |
2 files changed, 44 insertions, 0 deletions
diff --git a/patches/kmod-13/0001-missing-Don-t-call-syscall-with-syscallno-1.patch b/patches/kmod-13/0001-missing-Don-t-call-syscall-with-syscallno-1.patch new file mode 100644 index 000000000..a385d6320 --- /dev/null +++ b/patches/kmod-13/0001-missing-Don-t-call-syscall-with-syscallno-1.patch @@ -0,0 +1,40 @@ +From: Lucas De Marchi <lucas.de.marchi@gmail.com> +Date: Thu, 2 May 2013 13:22:57 -0300 +Subject: [PATCH] missing: Don't call syscall() with syscallno == -1 + +Reported-by: Jean-Francis Roy <jeanfrancis@funtoo.org> +Reported-by: Jan Luebbe <jlu@pengutronix.de> +--- + libkmod/missing.h | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +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 diff --git a/patches/kmod-13/series b/patches/kmod-13/series new file mode 100644 index 000000000..3fc301f89 --- /dev/null +++ b/patches/kmod-13/series @@ -0,0 +1,4 @@ +# generated by git-ptx-patches +#tag:base --start-number 1 +0001-missing-Don-t-call-syscall-with-syscallno-1.patch +# 0b7413dd7632441bc24225859a7d1866 - git-ptx-patches magic |