socklen_t addrlen;
bool bound;
bool connected;
- bool maybe_disconnected;
sd_event *event;
sd_event_source *event_source;
sd_event_source *event_source_connect;
.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);
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;
}
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;