Skip to content

Commit

Permalink
skip openat2 test if SYS_openat2 is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
GitMensch authored Dec 12, 2023
1 parent 20efc0d commit cab91e1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/test/openat2.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ int main(void) {
test_assert(filefd > 0);
test_assert(close(filefd) == 0);

#if defined(SYS_openat2)
struct open_how how = {0};
how.flags = O_CREAT | O_RDONLY;
how.mode = 0600;
Expand All @@ -41,6 +42,7 @@ int main(void) {
filefd = syscall(SYS_openat2, dirfd, REL_FILENAME, &how, sizeof(how));
test_assert(filefd > 0);
test_assert(close(filefd) == 0);
#endif

atomic_puts("EXIT-SUCCESS");
return 0;
Expand Down

0 comments on commit cab91e1

Please sign in to comment.