]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev-ctrl: drop the unused maybe_disconnected stuff 29847/head
authorDavid Tardon <dtardon@redhat.com>
Fri, 3 Nov 2023 13:08:37 +0000 (14:08 +0100)
committerDavid Tardon <dtardon@redhat.com>
Fri, 3 Nov 2023 17:44:26 +0000 (18:44 +0100)
src/udev/udev-ctrl.c

index 24ba8231f5992b33bc70b74b3b11a75bc5913702..28716347e7724c86228e26286c2c1b29952c0b7a 100644 (file)
@@ -37,7 +37,6 @@ struct UdevCtrl {
         socklen_t addrlen;
         bool bound;
         bool connected;
-        bool maybe_disconnected;
         sd_event *event;
         sd_event_source *event_source;
         sd_event_source *event_source_connect;
@@ -291,9 +290,6 @@ int udev_ctrl_send(UdevCtrl *uctrl, UdevCtrlMessageType type, const void *data)
                 .type = type,
         };
 
-        if (uctrl->maybe_disconnected)
-                return -ENOANO; /* to distinguish this from other errors. */
-
         if (type == UDEV_CTRL_SET_ENV) {
                 assert(data);
                 strscpy(ctrl_msg_wire.value.buf, sizeof(ctrl_msg_wire.value.buf), data);
@@ -309,9 +305,6 @@ int udev_ctrl_send(UdevCtrl *uctrl, UdevCtrlMessageType type, const void *data)
         if (send(uctrl->sock, &ctrl_msg_wire, sizeof(ctrl_msg_wire), 0) < 0)
                 return -errno;
 
-        if (type == UDEV_CTRL_EXIT)
-                uctrl->maybe_disconnected = true;
-
         return 0;
 }
 
@@ -326,11 +319,9 @@ int udev_ctrl_wait(UdevCtrl *uctrl, usec_t timeout) {
         if (!uctrl->connected)
                 return 0;
 
-        if (!uctrl->maybe_disconnected) {
-                r = udev_ctrl_send(uctrl, _UDEV_CTRL_END_MESSAGES, NULL);
-                if (r < 0)
-                        return r;
-        }
+        r = udev_ctrl_send(uctrl, _UDEV_CTRL_END_MESSAGES, NULL);
+        if (r < 0)
+                return r;
 
         if (timeout == 0)
                 return 0;