X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=src%2Fudev%2Fudev-ctrl.c;h=dafe3da2511b39ac55f701160277a3614f3adba6;hb=39cf0351c529584aa8f270e3b418d7ab9461b622;hp=d067279f3e1aea02c555a5a41a05af9607d18fcf;hpb=08508c4862c22aa2786c2436fa885d6c0f3b68ac;p=thirdparty%2Fsystemd.git diff --git a/src/udev/udev-ctrl.c b/src/udev/udev-ctrl.c index d067279f3e1..dafe3da2511 100644 --- a/src/udev/udev-ctrl.c +++ b/src/udev/udev-ctrl.c @@ -189,12 +189,12 @@ static int udev_ctrl_connection_event_handler(sd_event_source *s, int fd, uint32 _cleanup_(udev_ctrl_disconnect_and_listen_againp) struct udev_ctrl *uctrl = NULL; struct udev_ctrl_msg_wire msg_wire; struct iovec iov = IOVEC_MAKE(&msg_wire, sizeof(struct udev_ctrl_msg_wire)); - char cred_msg[CMSG_SPACE(sizeof(struct ucred))]; + CMSG_BUFFER_TYPE(CMSG_SPACE(sizeof(struct ucred))) control; struct msghdr smsg = { .msg_iov = &iov, .msg_iovlen = 1, - .msg_control = cred_msg, - .msg_controllen = sizeof(cred_msg), + .msg_control = &control, + .msg_controllen = sizeof(control), }; struct cmsghdr *cmsg; struct ucred *cred; @@ -392,9 +392,10 @@ int udev_ctrl_wait(struct udev_ctrl *uctrl, usec_t timeout) { (void) sd_event_source_set_description(source_io, "udev-ctrl-wait-io"); if (timeout != USEC_INFINITY) { - r = sd_event_add_time(uctrl->event, &source_timeout, clock_boottime_or_monotonic(), - usec_add(now(clock_boottime_or_monotonic()), timeout), - 0, NULL, INT_TO_PTR(-ETIMEDOUT)); + r = sd_event_add_time_relative( + uctrl->event, &source_timeout, clock_boottime_or_monotonic(), + timeout, + 0, NULL, INT_TO_PTR(-ETIMEDOUT)); if (r < 0) return r;