Prompted by #31789 (specifically
https://github.com/systemd/systemd/pull/31789#discussion_r1525267612)
assert(command);
assert(context);
assert(params);
- assert(params->fds || (params->n_socket_fds + params->n_storage_fds <= 0));
+ assert(!params->fds || FLAGS_SET(params->flags, EXEC_PASS_FDS));
+ assert(params->fds || (params->n_socket_fds + params->n_storage_fds == 0));
assert(!params->files_env); /* We fill this field, ensure it comes NULL-initialized to us */
assert(ret);
exec_params.open_files = s->open_files;
+ exec_params.flags |= EXEC_PASS_FDS;
+
log_unit_debug(UNIT(s), "Passing %zu fds to service", exec_params.n_socket_fds + exec_params.n_storage_fds);
}