summaryrefslogtreecommitdiff
path: root/src/basic/fs-util.h
diff options
context:
space:
mode:
authorFranck Bui <fbui@suse.com>2019-09-17 11:16:52 +0200
committerFranck Bui <fbui@suse.com>2019-10-05 08:08:20 +0200
commit27c3112dcbd1b5f171c36c32550d9c6331375b0b (patch)
tree2615b1f194118bd0726803704d12392cb32ad82a /src/basic/fs-util.h
parent5461cdebfa5e385706592253ce6261f92ce531db (diff)
downloadsystemd-27c3112dcbd1b5f171c36c32550d9c6331375b0b.tar.gz
fs-util: introduce inotify_add_watch_and_warn() helper
The default message for ENOSPC is very misleading: it says that the disk is filled, but in fact the inotify watch limit is the problem. So let's introduce and use a wrapper that simply calls inotify_add_watch(2) and which fixes the error message up in case ENOSPC is returned.
Diffstat (limited to 'src/basic/fs-util.h')
-rw-r--r--src/basic/fs-util.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/basic/fs-util.h b/src/basic/fs-util.h
index 1f0bdd95b3..fa0f0de9a3 100644
--- a/src/basic/fs-util.h
+++ b/src/basic/fs-util.h
@@ -72,6 +72,7 @@ union inotify_event_buffer {
};
int inotify_add_watch_fd(int fd, int what, uint32_t mask);
+int inotify_add_watch_and_warn(int fd, const char *pathname, uint32_t mask);
enum {
CHASE_PREFIX_ROOT = 1 << 0, /* The specified path will be prefixed by the specified root before beginning the iteration */