1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-11 09:18:07 +03:00

socket: hookup handoff timestamps with processes forked off by socket units

This commit is contained in:
Lennart Poettering 2024-04-24 09:47:29 +02:00
parent 3c1d1ca146
commit 1f41b10ee0

View File

@ -3378,6 +3378,22 @@ static void socket_trigger_notify(Unit *u, Unit *other) {
socket_set_state(s, SOCKET_RUNNING);
}
static void socket_handoff_timestamp(
Unit *u,
const struct ucred *ucred,
const dual_timestamp *ts) {
Socket *s = ASSERT_PTR(SOCKET(u));
assert(ucred);
assert(ts);
if (s->control_pid.pid == ucred->pid && s->control_command) {
exec_status_handoff(&s->control_command->exec_status, ucred, ts);
unit_add_to_dbus_queue(u);
}
}
static int socket_get_timeout(Unit *u, usec_t *timeout) {
Socket *s = ASSERT_PTR(SOCKET(u));
usec_t t;
@ -3580,6 +3596,8 @@ const UnitVTable socket_vtable = {
.reset_failed = socket_reset_failed,
.notify_handoff_timestamp = socket_handoff_timestamp,
.control_pid = socket_control_pid,
.bus_set_property = bus_socket_set_property,