summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-04-08 12:53:26 -0400
committerJune McEnroe <june@causal.agency>2018-04-08 12:53:26 -0400
commit7c88364f61728b67cc4b5ec1cce310fc6b8d5cf7 (patch)
tree09024255f5a13712c0bfcab32b9a1329780aa22b
parentCommit with june@causal.agency (diff)
downloadsrc-7c88364f61728b67cc4b5ec1cce310fc6b8d5cf7.tar.gz
src-7c88364f61728b67cc4b5ec1cce310fc6b8d5cf7.zip
Sleep in watch when a file is deleted
Reopening the path immediately would always fail. Wait a second for the
file to hopefully reappear.
-rw-r--r--bin/watch.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/bin/watch.c b/bin/watch.c
index 442835fa..f33c9ee7 100644
--- a/bin/watch.c
+++ b/bin/watch.c
@@ -85,6 +85,7 @@ int main(int argc, char *argv[]) {
 
         if (event.fflags & NOTE_DELETE) {
             close(event.ident);
+            sleep(1);
             watch(kq, event.udata);
         }