diff options
| author | Aleksa Sarai <[email protected]> | 2020-02-13 07:26:56 +0000 |
|---|---|---|
| committer | Shuah Khan <[email protected]> | 2020-02-13 20:15:45 +0000 |
| commit | 9a0584f05687947d5a0b87f046bcd2592a55e67c (patch) | |
| tree | e3cba4bbf9887d85332e056c852ecec9159f646c | |
| parent | selftests: use LDLIBS for libraries instead of LDFLAGS (diff) | |
| download | kernel-9a0584f05687947d5a0b87f046bcd2592a55e67c.tar.gz kernel-9a0584f05687947d5a0b87f046bcd2592a55e67c.zip | |
selftests: openat2: fix build error on newer glibc
It appears that newer glibcs check that openat(O_CREAT) was provided a
fourth argument (rather than passing garbage), resulting in the
following build error:
> In file included from /usr/include/fcntl.h:301,
> from helpers.c:9:
> In function 'openat',
> inlined from 'touchat' at helpers.c:49:11:
> /usr/include/x86_64-linux-gnu/bits/fcntl2.h:126:4: error: call to
> '__openat_missing_mode' declared with attribute error: openat with O_CREAT
> or O_TMPFILE in third argument needs 4 arguments
> 126 | __openat_missing_mode ();
> | ^~~~~~~~~~~~~~~~~~~~~~~~
Reported-by: Shuah Khan <[email protected]>
Signed-off-by: Aleksa Sarai <[email protected]>
Tested-by: Shuah Khan <[email protected]>
Signed-off-by: Shuah Khan <[email protected]>
| -rw-r--r-- | tools/testing/selftests/openat2/helpers.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/openat2/helpers.c b/tools/testing/selftests/openat2/helpers.c index e9a6557ab16f..5074681ffdc9 100644 --- a/tools/testing/selftests/openat2/helpers.c +++ b/tools/testing/selftests/openat2/helpers.c @@ -46,7 +46,7 @@ int sys_renameat2(int olddirfd, const char *oldpath, int touchat(int dfd, const char *path) { - int fd = openat(dfd, path, O_CREAT); + int fd = openat(dfd, path, O_CREAT, 0700); if (fd >= 0) close(fd); return fd; |
