terminate in case of no-sace-left-on-device when adding a user watch. ignore all other errors

This commit is contained in:
Axel Kittenberger 2011-08-17 11:28:32 +00:00
parent 09a0af3495
commit c21620d3e6
1 changed files with 7 additions and 0 deletions

View File

@ -100,6 +100,13 @@ l_addwatch(lua_State *L)
int wd = inotify_add_watch(inotify_fd, path, mask);
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,
errno, strerror(errno));
} else {