* of a client before it exits. */
on_notify_socket,
m,
- &m->notify_socket_path);
+ &m->notify_socket_path,
+ /* ret_event_source= */ NULL);
if (r < 0)
return log_error_errno(r, "Failed to prepare notify socket: %m");
SD_EVENT_PRIORITY_NORMAL,
manager_on_notify,
m,
- &m->notify_socket_path);
+ &m->notify_socket_path,
+ /* ret_event_source= */ NULL);
if (r < 0)
return r;
* more interesting, "positive" information. */
on_notify_socket,
&child,
- &addr_string);
+ &addr_string,
+ /* ret_event_source= */ NULL);
if (r < 0)
return log_error_errno(r, "Failed to prepare notify socket: %m");
int64_t priority,
sd_event_io_handler_t handler,
void *userdata,
- char **ret_path) {
+ char **ret_path,
+ sd_event_source **ret_event_source) {
int r;
assert(event);
- assert(ret_path);
/* This creates an autobind AF_UNIX socket and adds an IO event source for the socket, which helps
* prepare the notification socket used to communicate with worker processes. */
(void) sd_event_source_set_description(s, "notify-socket");
- r = sd_event_source_set_floating(s, true);
- if (r < 0)
- return log_debug_errno(r, "Failed to make notification event source floating: %m");
+ if (ret_event_source)
+ *ret_event_source = TAKE_PTR(s);
+ else {
+ r = sd_event_source_set_floating(s, true);
+ if (r < 0)
+ return log_debug_errno(r, "Failed to make notification event source floating: %m");
+ }
+
+ if (ret_path)
+ *ret_path = TAKE_PTR(path);
- *ret_path = TAKE_PTR(path);
return 0;
}
int64_t priority,
sd_event_io_handler_t handler,
void *userdata,
- char **ret_path);
+ char **ret_path,
+ sd_event_source **ret_event_source);
int notify_recv_with_fds(
int fd,
SD_EVENT_PRIORITY_NORMAL - 5,
helper_on_notify,
ctx,
- &bind_name);
+ &bind_name,
+ /* ret_event_source= */ NULL);
if (r < 0)
return log_error_errno(r, "Failed to prepare notify socket: %m");
SD_EVENT_PRIORITY_NORMAL,
manager_on_notify,
m,
- &m->notify_socket_path);
+ &m->notify_socket_path,
+ /* ret_event_source= */ NULL);
if (r < 0)
return r;
.pidref = PIDREF_NULL,
};
_cleanup_free_ char *path = NULL;
- ASSERT_OK(notify_socket_prepare(e, SD_EVENT_PRIORITY_NORMAL - 10, on_recv, &c, &path));
+ ASSERT_OK(notify_socket_prepare(e, SD_EVENT_PRIORITY_NORMAL - 10, on_recv, &c, &path, /* ret_event_source= */ NULL));
ASSERT_OK(sigprocmask_many(SIG_BLOCK, NULL, SIGCHLD));
EVENT_PRIORITY_WORKER_NOTIFY,
on_worker_notify,
manager,
- &manager->worker_notify_socket_path);
+ &manager->worker_notify_socket_path,
+ /* ret_event_source= */ NULL);
if (r < 0)
return log_error_errno(r, "Failed to prepare worker notification socket: %m");