Try using IN_DELETE_SELF with inotify

This commit is contained in:
ridiculousfish 2014-05-16 13:37:23 +08:00
parent e3cccdf571
commit e214df8980

View File

@ -2409,7 +2409,7 @@ static bool test_basic_inotify_support()
} }
/* Add file to watch list */ /* Add file to watch list */
int wd = inotify_add_watch(fd, INOTIFY_TEST_PATH, IN_DELETE); int wd = inotify_add_watch(fd, INOTIFY_TEST_PATH, IN_DELETE | IN_DELETE_SELF);
if (wd < 0) if (wd < 0)
{ {
err(L"inotify_add_watch failed: %s", strerror(errno)); err(L"inotify_add_watch failed: %s", strerror(errno));
@ -2437,7 +2437,6 @@ static bool test_basic_inotify_support()
if (count == 0 || ! FD_ISSET(fd, &fds)) if (count == 0 || ! FD_ISSET(fd, &fds))
{ {
inotify_works = false; inotify_works = false;
err(L"inotify file descriptor not readable. Is inotify busted?"); err(L"inotify file descriptor not readable. Is inotify busted?");
struct utsname version = {}; struct utsname version = {};
uname(&version); uname(&version);