From a20173a42df64515c0a5d1c5fba0c056a633a441 Mon Sep 17 00:00:00 2001 From: Bert Münnich Date: Wed, 17 May 2017 20:16:16 +0200 Subject: Detect all file overwrites in autoreload_inotify mv(1) inside the same filesystem was not detected. Supporting this case made it necessary to always watch the directory. Turns out the logic and state keeping between arl_setup() and arl_handle() is easier, when using different watch descriptors for the file and the directory and not using a oneshot descriptor for the file. Requiring an absolute canonical path for arl_setup() simplifies dir and base name splitting. No need for dirname(3) and basename(3) anymore. --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'main.c') diff --git a/main.c b/main.c index 70f7521..aa11616 100644 --- a/main.c +++ b/main.c @@ -723,7 +723,7 @@ void run(void) if (info.fd != -1 && FD_ISSET(info.fd, &fds)) read_info(); if (arl.fd != -1 && FD_ISSET(arl.fd, &fds)) { - if (arl_handle(&arl, files[fileidx].path)) { + if (arl_handle(&arl)) { /* when too fast, imlib2 can't load the image */ nanosleep(&ten_ms, NULL); load_image(fileidx); -- cgit v1.2.3-54-g00ecf