mirror of
https://github.com/AuxXxilium/kmod.git
synced 2024-11-23 23:10:53 +07:00
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.
This commit is contained in:
parent
03f7dfb868
commit
5eac795b8b
@ -20,8 +20,15 @@
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_FINIT_MODULE
|
||||
#include <errno.h>
|
||||
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user