summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Lammerts <busybox@lists.lammerts.org>2010-12-06 01:26:26 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2010-12-06 01:26:26 +0100
commit31905f94777ae6e7181e9fbcc0cc7c4cf70abfaf (patch)
tree0d54c18cbd2b34e554a3e959bd153e689cfc74ff
parentc60e88a5b9d750993f8e25a322ad7f6f09db8bda (diff)
downloadbusybox-w32-31905f94777ae6e7181e9fbcc0cc7c4cf70abfaf.tar.gz
busybox-w32-31905f94777ae6e7181e9fbcc0cc7c4cf70abfaf.tar.bz2
busybox-w32-31905f94777ae6e7181e9fbcc0cc7c4cf70abfaf.zip
runsvdir: do not miss closely spaced service dir changes
Signed-off-by: Eric Lammerts <busybox@lists.lammerts.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--runit/runsvdir.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/runit/runsvdir.c b/runit/runsvdir.c
index e77eeff04..166664237 100644
--- a/runit/runsvdir.c
+++ b/runit/runsvdir.c
@@ -312,8 +312,11 @@ int runsvdir_main(int argc UNUSED_PARAM, char **argv)
312 last_mtime = s.st_mtime; 312 last_mtime = s.st_mtime;
313 last_dev = s.st_dev; 313 last_dev = s.st_dev;
314 last_ino = s.st_ino; 314 last_ino = s.st_ino;
315 //if (now <= mtime) 315 /* if the svdir changed this very second, wait until the
316 // sleep(1); 316 * next second, because we won't be able to detect more
317 * changes within this second */
318 while (time(NULL) == last_mtime)
319 usleep(100000);
317 need_rescan = do_rescan(); 320 need_rescan = do_rescan();
318 while (fchdir(curdir) == -1) { 321 while (fchdir(curdir) == -1) {
319 warn2_cannot("change directory, pausing", ""); 322 warn2_cannot("change directory, pausing", "");