blob: 41ad570a9a10b5d27f9f32f4e7792a98345cab71 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
diff -urpN busybox-1.18.0/runit/runsvdir.c busybox-1.18.0-runsvdir/runit/runsvdir.c
--- busybox-1.18.0/runit/runsvdir.c 2010-11-22 21:43:22.000000000 +0100
+++ busybox-1.18.0-runsvdir/runit/runsvdir.c 2010-12-06 01:27:56.926036992 +0100
@@ -312,8 +312,11 @@ int runsvdir_main(int argc UNUSED_PARAM,
last_mtime = s.st_mtime;
last_dev = s.st_dev;
last_ino = s.st_ino;
- //if (now <= mtime)
- // sleep(1);
+ /* if the svdir changed this very second, wait until the
+ * next second, because we won't be able to detect more
+ * changes within this second */
+ while (time(NULL) == last_mtime)
+ usleep(100000);
need_rescan = do_rescan();
while (fchdir(curdir) == -1) {
warn2_cannot("change directory, pausing", "");
|