test: use sleep() for mtime delay

For filesystems without high-resolution time support, an usleep() is too short
to alter mtime. Though 1s is quite safe, sleep for 2s in case it gets awaken
right within that second.
This commit is contained in:
yangfl committed 2022-01-26 23:57:27 +08:00
1 parent 0cda6339a4
commit 059bfd7806
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -41,7 +41,7 @@ static int mtime()
char buf[80];
/* Must sleep a while here otherwise we execute too fast => no mtime change :-( */
usleep(10000);
sleep(2);
PRINT("Calling pidfile() again to update mtime ...\n");
if (pidfile(pidfile_arg))
+1 -1
View File
@@ -23,7 +23,7 @@ static int mtime(char *file)
stat(file, &before);
/* Must sleep a while here otherwise we execute too fast => no mtime change :-( */
usleep(10000);
sleep(2);
PRINT("Calling touch() again to update mtime ...\n");
if (touch(file)) {