summary refs log tree commit diff
path: root/bin
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
commitb774d67ea16b81420a7b62ba210b1f1c5ae6aae7 (patch)
treeecd0ba4e003561d35c6ec13643911657ab5e2dd1 /bin
parentCommit with june@causal.agency (diff)
downloadsrc-b774d67ea16b81420a7b62ba210b1f1c5ae6aae7.tar.gz
src-b774d67ea16b81420a7b62ba210b1f1c5ae6aae7.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.
Diffstat (limited to '')
-rw-r--r--bin/watch.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/bin/watch.c b/bin/watch.c
index ed499652..9b83410f 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);
         }