From 3db2c1a90b746aa778a45aaa363f117853ab0ac5 Mon Sep 17 00:00:00 2001
From: Mike Yuan <me@yhndnzj.com>
Date: Thu, 30 Nov 2023 19:16:49 +0800
Subject: [PATCH 0012/1160] core/exec-invoke: rename flags_fds to flag_fds
(cherry picked from commit d8da25b5d9c9251baf64cff1c8612a465d7b5415)
src/core/exec-invoke.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
@@ -105,7 +105,7 @@ static int shift_fds(int fds[], size_t n_fds) {
return 0;
}
-static int flags_fds(
+static int flag_fds(
const int fds[],
size_t n_socket_fds,
size_t n_fds,
@@ -113,10 +113,7 @@ static int flags_fds(
int r;
- if (n_fds <= 0)
- return 0;
-
- assert(fds);
+ assert(fds || n_fds == 0);
/* Drops/Sets O_NONBLOCK and FD_CLOEXEC from the file flags.
* O_NONBLOCK only applies to socket activation though. */
@@ -4808,7 +4805,7 @@ int exec_invoke(
if (r >= 0)
r = shift_fds(fds, n_fds);
if (r >= 0)
- r = flags_fds(fds, n_socket_fds, n_fds, context->non_blocking);
+ r = flag_fds(fds, n_socket_fds, n_fds, context->non_blocking);
if (r < 0) {
*exit_status = EXIT_FDS;
return log_exec_error_errno(context, params, r, "Failed to adjust passed file descriptors: %m");
--
2.33.0