Skip to content

Commit

Permalink
update ifdef to ifndef
Browse files Browse the repository at this point in the history
Signed-off-by: yzewei <[email protected]>
  • Loading branch information
yzewei committed Apr 19, 2024
1 parent e5328b9 commit b75bc46
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,11 @@ void do___open_by_handle_atX_success(int *open_by_handle_fd, int *dirfd, char *f
}
}

#ifndef __loongarch64
/*
* 6. Get dev and ino.
*/
struct stat file_stat;
#if defined(__loongarch64)
#else
assert_syscall_state(SYSCALL_SUCCESS, "fstat", syscall(__NR_fstat, *open_by_handle_fd, &file_stat), NOT_EQUAL, -1);
*dev = (uint32_t)file_stat.st_dev;
*inode = file_stat.st_ino;
Expand Down Expand Up @@ -189,8 +188,7 @@ TEST(SyscallExit, open_by_handle_atX_success)
/* Parameter 4: path (type: PT_FSPATH) */
evt_test->assert_charbuf_param(4, fspath);

#if defined(__loongarch64)
#elif
#ifndef __loongarch64
/* Parameter 5: dev (type: PT_UINT32) */
evt_test->assert_numeric_param(5, dev);

Expand Down Expand Up @@ -248,8 +246,7 @@ TEST(SyscallExit, open_by_handle_atX_success_mp)
/* Parameter 4: path (type: PT_FSPATH) */
evt_test->assert_charbuf_param(4, fspath);

#if defined(__loongarch64)
#elif
#ifndef __loongarch64
/* Parameter 5: dev (type: PT_UINT32) */
evt_test->assert_numeric_param(5, dev);

Expand Down
12 changes: 4 additions & 8 deletions test/drivers/test_suites/syscall_exit_suite/openat2_x.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ TEST(SyscallExit, openat2X_success)
int32_t fd = syscall(__NR_openat2, dirfd, pathname, &how, sizeof(struct open_how));
assert_syscall_state(SYSCALL_SUCCESS, "openat2", fd, NOT_EQUAL, -1);

#if defined(__loongarch64)
#elif
#ifndef __loongarch64
/* Call `fstat` to retrieve the `dev` and `ino`. */
struct stat file_stat;
assert_syscall_state(SYSCALL_SUCCESS, "fstat", syscall(__NR_fstat, fd, &file_stat), NOT_EQUAL, -1);
Expand Down Expand Up @@ -69,8 +68,7 @@ TEST(SyscallExit, openat2X_success)
/* Parameter 6: resolve (type: PT_FLAGS32) */
evt_test->assert_numeric_param(6, (uint32_t)PPM_RESOLVE_BENEATH | PPM_RESOLVE_NO_MAGICLINKS);

#if defined(__loongarch64)
#elif
#ifndef __loongarch64
/* Parameter 7: dev (type: PT_UINT32) */
evt_test->assert_numeric_param(7, dev);

Expand Down Expand Up @@ -171,8 +169,7 @@ TEST(SyscallExit, openat2X_create_success)
int32_t fd = syscall(__NR_openat2, dirfd, pathname, &how, sizeof(struct open_how));
assert_syscall_state(SYSCALL_SUCCESS, "openat2", fd, NOT_EQUAL, -1);

#if defined(__loongarch64)
#elif
#ifndef __loongarch64
/* Call `fstat` to retrieve the `dev` and `ino`. */
struct stat file_stat;
assert_syscall_state(SYSCALL_SUCCESS, "fstat", syscall(__NR_fstat, fd, &file_stat), NOT_EQUAL, -1);
Expand Down Expand Up @@ -216,8 +213,7 @@ TEST(SyscallExit, openat2X_create_success)
/* Parameter 6: resolve (type: PT_FLAGS32) */
evt_test->assert_numeric_param(6, (uint32_t)PPM_RESOLVE_BENEATH | PPM_RESOLVE_NO_MAGICLINKS);

#if defined(__loongarch64)
#elif
#ifndef __loongarch64
/* Parameter 7: dev (type: PT_UINT32) */
evt_test->assert_numeric_param(7, dev);

Expand Down

0 comments on commit b75bc46

Please sign in to comment.