mirror of
https://github.com/troglobit/finit.git
synced 2026-10-08 08:24:43 +07:00
iwatch: minor, check if file/dir exists before trying to add
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
@@ -80,6 +80,10 @@ int iwatch_add(struct iwatch *iw, char *file, uint32_t mask)
|
||||
if (!initialized)
|
||||
return -1;
|
||||
|
||||
if (!fexist(file)) {
|
||||
_d("No such file or directory, skipping %s", file);
|
||||
return 0;
|
||||
}
|
||||
_d("Adding new watcher for path %s", file);
|
||||
|
||||
path = strdup(file);
|
||||
|
||||
Reference in New Issue
Block a user