diff --git a/bin/linux/fsnotifier b/bin/linux/fsnotifier index 85973cc4aa1e..134573032b57 100755 Binary files a/bin/linux/fsnotifier and b/bin/linux/fsnotifier differ diff --git a/bin/linux/fsnotifier64 b/bin/linux/fsnotifier64 index e4b3e5637b1f..0fae80c30ced 100755 Binary files a/bin/linux/fsnotifier64 and b/bin/linux/fsnotifier64 differ diff --git a/native/fsNotifier/linux/inotify.c b/native/fsNotifier/linux/inotify.c index 444a5bf978a0..77536dc3dcba 100644 --- a/native/fsNotifier/linux/inotify.c +++ b/native/fsNotifier/linux/inotify.c @@ -305,14 +305,17 @@ int watch(const char* root, array* mounts) { struct stat st; if (stat(root, &st) != 0) { - if (errno == EACCES) { - return ERR_IGNORE; - } - else if (errno == ENOENT) { + if (errno == ENOENT) { return ERR_MISSING; } - userlog(LOG_ERR, "stat(%s): %s", root, strerror(errno)); - return ERR_ABORT; + else if (errno == EACCES || errno == ELOOP || errno == ENAMETOOLONG || errno == ENOTDIR) { + userlog(LOG_INFO, "stat(%s): %s", root, strerror(errno)); + return ERR_CONTINUE; + } + else { + userlog(LOG_ERR, "stat(%s): %s", root, strerror(errno)); + return ERR_ABORT; + } } if (S_ISREG(st.st_mode)) { diff --git a/native/fsNotifier/linux/main.c b/native/fsNotifier/linux/main.c index de87fad9479d..5b9ee0933b3d 100644 --- a/native/fsNotifier/linux/main.c +++ b/native/fsNotifier/linux/main.c @@ -36,7 +36,7 @@ #define LOG_ENV_ERROR "error" #define LOG_ENV_OFF "off" -#define VERSION "20130415.2136" +#define VERSION "20130617.1827" #define VERSION_MSG "fsnotifier " VERSION "\n" #define USAGE_MSG \ diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/FileWatcherTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/FileWatcherTest.java index c5fb489f5ce9..c133139644db 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/FileWatcherTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/FileWatcherTest.java @@ -292,6 +292,26 @@ public class FileWatcherTest extends PlatformLangTestCase { } } + public void testIncorrectPath() throws Exception { + File topDir = createTestDir("top"); + File file = createTestFile(topDir, "file.zip"); + File subDir = new File(file, "sub/zip"); + refresh(topDir); + + LocalFileSystem.WatchRequest request = watch(subDir, false); + try { + myTimeout = 10 * INTER_RESPONSE_DELAY; + myAccept = true; + FileUtil.writeToFile(file, "new content"); + assertEvent(VFileEvent.class); + myTimeout = NATIVE_PROCESS_DELAY; + } + finally { + unwatch(request); + delete(topDir); + } + } + public void testDirectoryOverlapping() throws Exception { File topDir = createTestDir("top"); File fileInTopDir = createTestFile(topDir, "file1.txt");