mirror of https://github.com/octoleo/lsyncd.git
terminate in case of no-sace-left-on-device when adding a user watch. ignore all other errors
This commit is contained in:
parent
09a0af3495
commit
c21620d3e6
|
@ -100,6 +100,13 @@ l_addwatch(lua_State *L)
|
||||||
|
|
||||||
int wd = inotify_add_watch(inotify_fd, path, mask);
|
int wd = inotify_add_watch(inotify_fd, path, mask);
|
||||||
if (wd < 0) {
|
if (wd < 0) {
|
||||||
|
if (errno == ENOSPC) {
|
||||||
|
printlogf(L, "Error",
|
||||||
|
"Terminating since out of inotify watches.");
|
||||||
|
printlogf(L, "Error",
|
||||||
|
"Consider increasing /proc/sys/fs/inotify/max_user_watches");
|
||||||
|
exit(-1); // ERRNO.
|
||||||
|
}
|
||||||
printlogf(L, "Inotify", "addwatch(%s)->%d; err=%d:%s", path, wd,
|
printlogf(L, "Inotify", "addwatch(%s)->%d; err=%d:%s", path, wd,
|
||||||
errno, strerror(errno));
|
errno, strerror(errno));
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue