aboutsummaryrefslogtreecommitdiffhomepage
path: root/fish_tests.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-05-16 12:54:52 +0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-05-16 12:54:52 +0800
commita0bf841be226ae631f706cef77cfab81a5e77abe (patch)
tree33ad3a0f12c684684cb00c91b2c7527c1bd61146 /fish_tests.cpp
parent73cbb0c65f5607532b7534982adaf5079c1a1a5e (diff)
Check for non-negative watch object in inotify_add_watch
Diffstat (limited to 'fish_tests.cpp')
-rw-r--r--fish_tests.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/fish_tests.cpp b/fish_tests.cpp
index 3b738d66..65a2484d 100644
--- a/fish_tests.cpp
+++ b/fish_tests.cpp
@@ -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))