X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fpath.c;h=20e454d96f4c1ba04a463c7ac92d920303e12948;hb=530a9662aa3d291555e5b3f6eb43199e1b04f63c;hp=1d6c6cc6cb6217a4ae6feda0dcc056f74a37f582;hpb=151b9b9662a90455262ce575a8a8ae74bf4ff336;p=elogind.git diff --git a/src/core/path.c b/src/core/path.c index 1d6c6cc6c..20e454d96 100644 --- a/src/core/path.c +++ b/src/core/path.c @@ -152,11 +152,7 @@ void path_spec_unwatch(PathSpec *s) { assert(s); s->event_source = sd_event_source_unref(s->event_source); - - if (s->inotify_fd >= 0) { - close_nointr_nofail(s->inotify_fd); - s->inotify_fd = -1; - } + s->inotify_fd = safe_close(s->inotify_fd); } int path_spec_fd_event(PathSpec *s, uint32_t revents) { @@ -761,16 +757,16 @@ DEFINE_STRING_TABLE_LOOKUP(path_state, PathState); static const char* const path_type_table[_PATH_TYPE_MAX] = { [PATH_EXISTS] = "PathExists", [PATH_EXISTS_GLOB] = "PathExistsGlob", + [PATH_DIRECTORY_NOT_EMPTY] = "DirectoryNotEmpty", [PATH_CHANGED] = "PathChanged", [PATH_MODIFIED] = "PathModified", - [PATH_DIRECTORY_NOT_EMPTY] = "DirectoryNotEmpty" }; DEFINE_STRING_TABLE_LOOKUP(path_type, PathType); static const char* const path_result_table[_PATH_RESULT_MAX] = { [PATH_SUCCESS] = "success", - [PATH_FAILURE_RESOURCES] = "resources" + [PATH_FAILURE_RESOURCES] = "resources", }; DEFINE_STRING_TABLE_LOOKUP(path_result, PathResult);