Check for non-negative watch object in inotify_add_watch

This commit is contained in:
ridiculousfish 2014-05-16 12:54:52 +08:00
parent 73cbb0c65f
commit a0bf841be2

View file

@ -2407,8 +2407,12 @@ static bool test_basic_inotify_support()
err(L"touch failed");
}
/* add file to watch list */
/* Add file to watch list */
int wd = inotify_add_watch(fd, INOTIFY_TEST_PATH, IN_DELETE);
if (wd < 0)
{
err(L"inotify_add_watch failed: %s", strerror(errno));
}
/* Delete file */
if (system("rm " INOTIFY_TEST_PATH))