[LTP] [PATCH 2/2] syscalls/utime03: Fix timestamp checks
Martin Doucha
mdoucha@suse.cz
Thu Sep 23 15:27:49 CEST 2021
The timestamps set by utime(path, NULL) may slightly lag behind time() return
values. Use get_fs_timestamp() to get the correct expected time range.
Signed-off-by: Martin Doucha <mdoucha@suse.cz>
---
testcases/kernel/syscalls/utime/utime03.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/testcases/kernel/syscalls/utime/utime03.c b/testcases/kernel/syscalls/utime/utime03.c
index f581273f7..d120b63ee 100644
--- a/testcases/kernel/syscalls/utime/utime03.c
+++ b/testcases/kernel/syscalls/utime/utime03.c
@@ -26,6 +26,7 @@
#include "tst_test.h"
#include "tst_uid.h"
+#include "tst_clocks.h"
#define MNTPOINT "mntpoint"
#define TEMP_FILE MNTPOINT"/tmp_file"
@@ -71,9 +72,9 @@ static void run(void)
}
SAFE_SETEUID(user_uid);
- mintime = time(0);
+ mintime = get_fs_timestamp();
TST_EXP_PASS(utime(TEMP_FILE, NULL));
- maxtime = time(0);
+ maxtime = get_fs_timestamp();
SAFE_SETEUID(root_uid);
SAFE_STAT(TEMP_FILE, &statbuf);
--
2.33.0
More information about the ltp
mailing list