Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
systemd
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
certo
systemd
Commits
fb6d823e
Commit
fb6d823e
authored
Jan 30, 2022
by
Vladimir Bashkirtsev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix inotify helper allowing time-wait-sync to proceed
parent
4f82fdd4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
0 deletions
+55
-0
Makefile
Makefile
+1
-0
systemd-245-return_the_correct_wd_from_inotify_helpers.patch
systemd-245-return_the_correct_wd_from_inotify_helpers.patch
+54
-0
No files found.
Makefile
View file @
fb6d823e
target all
:
LC_ALL=$(SYSTEM_LOCALE)
target all
:
LC_ALL=$(SYSTEM_LOCALE)
all
:
systemd-user-sessions network-config
all
:
systemd-user-sessions network-config
tar
xf systemd-245.tar.gz
tar
xf systemd-245.tar.gz
patch
-Np1
-d
systemd-245 < systemd-245-return_the_correct_wd_from_inotify_helpers.patch
patch
-Np1
-d
systemd-245 < systemd-245-gcc_10-fixes-2.patch
patch
-Np1
-d
systemd-245 < systemd-245-gcc_10-fixes-2.patch
ln
-s
/tools/bin/true /usr/bin/xsltproc
ln
-s
/tools/bin/true /usr/bin/xsltproc
cd
systemd-245
&&
tar
xf ../systemd-man-pages-245.tar.xz
cd
systemd-245
&&
tar
xf ../systemd-man-pages-245.tar.xz
...
...
systemd-245-return_the_correct_wd_from_inotify_helpers.patch
0 → 100644
View file @
fb6d823e
From f6f4f5fe5395a57f10dd446c7266c53f0673eaac Mon Sep 17 00:00:00 2001
From: Balaji Punnuru <balaji_punnuru@cable.comcast.com>
Date: Thu, 9 Apr 2020 12:21:49 -0400
Subject: [PATCH] util: return the correct correct wd from inotify helpers
We need to propagate the acquired watch descriptors because our callers
are counting on them.
[Lennart: this is split out of #15381 and simplified]
---
src/basic/fs-util.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/src/basic/fs-util.c b/src/basic/fs-util.c
index 558cafbcaf53..ef3b5a51842f 100644
--- a/src/basic/fs-util.c
+++ b/src/basic/fs-util.c
@@ -692,28 +692,30 @@
int unlink_or_warn(const char *filename) {
int inotify_add_watch_fd(int fd, int what, uint32_t mask) {
char path[STRLEN("/proc/self/fd/") + DECIMAL_STR_MAX(int) + 1];
- int r;
+ int wd;
/* This is like inotify_add_watch(), except that the file to watch is not referenced by a path, but by an fd */
xsprintf(path, "/proc/self/fd/%i", what);
- r = inotify_add_watch(fd, path, mask);
- if (r < 0)
+ wd = inotify_add_watch(fd, path, mask);
+ if (wd < 0)
return -errno;
- return r;
+ return wd;
}
int inotify_add_watch_and_warn(int fd, const char *pathname, uint32_t mask) {
+ int wd;
- if (inotify_add_watch(fd, pathname, mask) < 0) {
+ wd = inotify_add_watch(fd, pathname, mask);
+ if (wd < 0) {
if (errno == ENOSPC)
return log_error_errno(errno, "Failed to add a watch for %s: inotify watch limit reached", pathname);
return log_error_errno(errno, "Failed to add a watch for %s: %m", pathname);
}
- return 0;
+ return wd;
}
static bool unsafe_transition(const struct stat *a, const struct stat *b) {
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment