]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
vmspawn: modernize setup_notify_parent() a bit
authorLennart Poettering <lennart@poettering.net>
Fri, 19 Jan 2024 17:04:56 +0000 (18:04 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 22 Jan 2024 13:03:09 +0000 (14:03 +0100)
src/vmspawn/vmspawn.c

index 40ebe72c893908263c8e89f78ec783676eceabfa..d846a4a3359c55743e81a4d890820a49b4dfe66f 100644 (file)
@@ -379,14 +379,19 @@ static int vmspawn_dispatch_vsock_connections(sd_event_source *source, int fd, u
         return 0;
 }
 
-static int setup_notify_parent(sd_event *event, int fd, int *exit_status, sd_event_source **notify_event_source) {
+static int setup_notify_parent(sd_event *event, int fd, int *exit_status, sd_event_source **ret_notify_event_source) {
         int r;
 
-        r = sd_event_add_io(event, notify_event_source, fd, EPOLLIN, vmspawn_dispatch_vsock_connections, exit_status);
+        assert(event);
+        assert(fd >= 0);
+        assert(exit_status);
+        assert(ret_notify_event_source);
+
+        r = sd_event_add_io(event, ret_notify_event_source, fd, EPOLLIN, vmspawn_dispatch_vsock_connections, exit_status);
         if (r < 0)
                 return log_error_errno(r, "Failed to allocate notify socket event source: %m");
 
-        (void) sd_event_source_set_description(*notify_event_source, "vmspawn-notify-sock");
+        (void) sd_event_source_set_description(*ret_notify_event_source, "vmspawn-notify-sock");
 
         return 0;
 }