From: Zbigniew Jędrzejewski-Szmek Date: Wed, 3 Apr 2019 10:36:03 +0000 (+0200) Subject: test-seccomp: fix compilation on arm64 X-Git-Tag: v242-rc3~10^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dff6c6295b1cb09d6da8ab054e66059e43247ab1;p=thirdparty%2Fsystemd.git test-seccomp: fix compilation on arm64 It has no open(). --- diff --git a/src/test/test-seccomp.c b/src/test/test-seccomp.c index 8efbecbeffb..9b7307cf393 100644 --- a/src/test/test-seccomp.c +++ b/src/test/test-seccomp.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -763,9 +764,14 @@ static void test_lock_personality(void) { static int real_open(const char *path, int flags, mode_t mode) { /* glibc internally calls openat() when open() is requested. Let's hence define our own wrapper for - * testing purposes that calls the real syscall. */ + * testing purposes that calls the real syscall, on architectures where SYS_open is defined. On + * other architectures, let's just fall back to the glibc call. */ +#ifdef SYS_open return (int) syscall(SYS_open, path, flags, mode); +#else + return open(path, flags, mode); +#endif } static void test_restrict_suid_sgid(void) {