diff options
| author | Zhangjin Wu <falcon@tinylab.org> | 2023-07-08 02:43:44 +0800 |
|---|---|---|
| committer | Willy Tarreau <w@1wt.eu> | 2023-08-23 04:38:02 +0200 |
| commit | f576d3c075dbc469480e737a97916be3c8f1a723 (patch) | |
| tree | 236a1f3aebd0a99897317b066b94690e9fd4c508 /tools | |
| parent | 38fc0a3553ced0158d97047f5fb3b73898226a3c (diff) | |
selftests/nolibc: stat_timestamps: remove procfs dependency
'/proc/self/' is a good path which doesn't have stale time info but it
is only available for CONFIG_PROC_FS=y.
When CONFIG_PROC_FS=n, use argv0 instead of '/proc/self', use '/' for the
worst case.
Reviewed-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Zhangjin Wu <falcon@tinylab.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/testing/selftests/nolibc/nolibc-test.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c index 64fca7c6ca49..d7a84ef10bba 100644 --- a/tools/testing/selftests/nolibc/nolibc-test.c +++ b/tools/testing/selftests/nolibc/nolibc-test.c @@ -584,7 +584,7 @@ static int test_stat_timestamps(void) if (sizeof(st.st_atim.tv_sec) != sizeof(st.st_atime)) return 1; - if (stat("/proc/self/", &st)) + if (stat("/proc/self/", &st) && stat(argv0, &st) && stat("/", &st)) return 1; if (st.st_atim.tv_sec != st.st_atime || st.st_atim.tv_nsec > 1000000000) |
