summaryrefslogtreecommitdiffstats
path: root/src/portable
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-04-04 11:27:08 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-04-12 11:44:57 +0200
commit02e23d1a1a8c3baf73d82da5abbab3a4eeb1cbf4 (patch)
treea7b7f26ec3058af9278cd4e2e40f87d4232bdf94 /src/portable
parentMake fopen_temporary and fopen_temporary_label unlocked (diff)
downloadsystemd-02e23d1a1a8c3baf73d82da5abbab3a4eeb1cbf4.tar.xz
systemd-02e23d1a1a8c3baf73d82da5abbab3a4eeb1cbf4.zip
Add fdopen_unlocked() wrapper
Diffstat (limited to 'src/portable')
-rw-r--r--src/portable/portable.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/portable/portable.c b/src/portable/portable.c
index 9b6cc21d2c..4aa879801f 100644
--- a/src/portable/portable.c
+++ b/src/portable/portable.c
@@ -1091,12 +1091,10 @@ static int test_chroot_dropin(
return log_debug_errno(errno, "Failed to open %s/%s: %m", where, p);
}
- f = fdopen(fd, "r");
- if (!f)
- return log_debug_errno(errno, "Failed to convert file handle: %m");
- fd = -1;
-
- (void) __fsetlocking(f, FSETLOCKING_BYCALLER);
+ r = fdopen_unlocked(fd, "r", &f);
+ if (r < 0)
+ return log_debug_errno(r, "Failed to convert file handle: %m");
+ TAKE_FD(fd);
r = read_line(f, LONG_LINE_MAX, &line);
if (r < 0)