mirror of
https://github.com/octoleo/lsyncd.git
synced 2024-12-13 14:43:09 +00:00
error message on failed inotify addwatch
This commit is contained in:
parent
6045128e35
commit
2cc23bb5b1
@ -72,7 +72,12 @@ l_addwatch(lua_State *L)
|
|||||||
{
|
{
|
||||||
const char *path = luaL_checkstring(L, 1);
|
const char *path = luaL_checkstring(L, 1);
|
||||||
int wd = inotify_add_watch(inotify_fd, path, standard_event_mask);
|
int wd = inotify_add_watch(inotify_fd, path, standard_event_mask);
|
||||||
|
if (wd < 0) {
|
||||||
|
printlogf(L, "Inotify", "addwatch(%s)->%d; err=%d:%s", path, wd,
|
||||||
|
errno, strerror(errno));
|
||||||
|
} else {
|
||||||
printlogf(L, "Inotify", "addwatch(%s)->%d", path, wd);
|
printlogf(L, "Inotify", "addwatch(%s)->%d", path, wd);
|
||||||
|
}
|
||||||
lua_pushinteger(L, wd);
|
lua_pushinteger(L, wd);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user