From: Jan Luebbe Date: Thu, 2 May 2013 14:47:12 +0000 (+0200) Subject: libkmod: Avoid calling syscall() with -1 X-Git-Tag: v14~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5eac795b8b067842caec32f96d55a7554c3c67f9;p=platform%2Fupstream%2Fkmod.git libkmod: Avoid calling syscall() with -1 At least in qemu 1.4.1 for vexpress/arm-cortexa9, this resulted in an illegal instruction error. Solve that by returning an error when __NR_finit_module is -1. --- diff --git a/libkmod/missing.h b/libkmod/missing.h index edb88b9..b45bbe2 100644 --- a/libkmod/missing.h +++ b/libkmod/missing.h @@ -20,8 +20,15 @@ #endif #ifndef HAVE_FINIT_MODULE +#include + static inline int finit_module(int fd, const char *uargs, int flags) { + if (__NR_finit_module == -1) { + errno = ENOSYS; + return -1; + } + return syscall(__NR_finit_module, fd, uargs, flags); } #endif