From: Mike Yuan Date: Thu, 30 Nov 2023 11:16:49 +0000 (+0800) Subject: core/exec-invoke: rename flags_fds to flag_fds X-Git-Tag: v256-rc1~1568^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d8da25b5d9c9251baf64cff1c8612a465d7b5415;p=thirdparty%2Fsystemd.git core/exec-invoke: rename flags_fds to flag_fds --- diff --git a/src/core/exec-invoke.c b/src/core/exec-invoke.c index 1e08296b466..a5298329b0b 100644 --- a/src/core/exec-invoke.c +++ b/src/core/exec-invoke.c @@ -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. */ @@ -4807,7 +4804,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");