diff options
author | Franck Bui <fbui@suse.com> | 2019-09-17 11:16:52 +0200 |
---|---|---|
committer | Franck Bui <fbui@suse.com> | 2019-10-05 08:08:20 +0200 |
commit | 27c3112dcbd1b5f171c36c32550d9c6331375b0b (patch) | |
tree | 2615b1f194118bd0726803704d12392cb32ad82a /src/time-wait-sync | |
parent | 5461cdebfa5e385706592253ce6261f92ce531db (diff) | |
download | systemd-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/time-wait-sync')
-rw-r--r-- | src/time-wait-sync/time-wait-sync.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/time-wait-sync/time-wait-sync.c b/src/time-wait-sync/time-wait-sync.c index f4d20af2d4..5b27df1f9e 100644 --- a/src/time-wait-sync/time-wait-sync.c +++ b/src/time-wait-sync/time-wait-sync.c @@ -225,9 +225,9 @@ static int run(int argc, char * argv[]) { if (r < 0) return log_error_errno(r, "Failed to create notify event source: %m"); - r = inotify_add_watch(state.inotify_fd, "/run/systemd/", IN_CREATE); + r = inotify_add_watch_and_warn(state.inotify_fd, "/run/systemd/", IN_CREATE); if (r < 0) - return log_error_errno(errno, "Failed to watch /run/systemd/: %m"); + return r; state.run_systemd_wd = r; |