/* SPDX-License-Identifier: LGPL-2.1+ */
-#include <stdio_ext.h>
-
#include "bus-common-errors.h"
#include "bus-error.h"
#include "conf-files.h"
#include "loop-util.h"
#include "machine-image.h"
#include "mkdir.h"
+#include "nulstr-util.h"
#include "os-util.h"
#include "path-lookup.h"
#include "portable.h"
#include "set.h"
#include "signal-util.h"
#include "socket-util.h"
+#include "sort-util.h"
#include "string-table.h"
#include "strv.h"
#include "tmpfile-util.h"
if (flags & PORTABLE_PREFER_COPY) {
- r = copy_file_atomic(from, dropin, 0644, 0, COPY_REFLINK);
+ r = copy_file_atomic(from, dropin, 0644, 0, 0, COPY_REFLINK);
if (r < 0)
return log_debug_errno(r, "Failed to copy %s %s %s: %m", from, special_glyph(SPECIAL_GLYPH_ARROW), 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)