mirror of
https://github.com/troglobit/libite.git
synced 2026-10-17 10:39:36 +00:00
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:
1 parent
0cda6339a4
commit
059bfd7806
2 files changed
+2
-2
No files matched your search
+1
-1
@@ -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
@@ -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)) {
|
||||
|
||||
Reference in new issue
Block a user