logging_init("udevd-event");
setpriority(PRIO_PROCESS, 0, UDEV_PRIORITY);
+
retval = udev_event_process(msg);
info("seq %llu finished", msg->seqnum);
static int running_processes(void)
{
int f;
- static char buf[32768];
+ char buf[32768];
int len;
int running;
const char *pos;
}
/* receive the udevd message from userspace */
-static struct uevent_msg *get_udevd_msg(void)
+static void get_udevd_msg(void)
{
- static struct udevd_msg ctrl_msg;
+ struct udevd_msg ctrl_msg;
ssize_t size;
struct msghdr smsg;
struct cmsghdr *cmsg;
if (size < 0) {
if (errno != EINTR)
err("unable to receive user udevd message: %s", strerror(errno));
- return NULL;
+ return;
}
cmsg = CMSG_FIRSTHDR(&smsg);
cred = (struct ucred *) CMSG_DATA(cmsg);
if (cmsg == NULL || cmsg->cmsg_type != SCM_CREDENTIALS) {
err("no sender credentials received, message ignored");
- return NULL;
+ return;
}
if (cred->uid != 0) {
err("sender uid=%i, message ignored", cred->uid);
- return NULL;
+ return;
}
if (strncmp(ctrl_msg.magic, UDEV_MAGIC, sizeof(UDEV_MAGIC)) != 0 ) {
err("message magic '%s' doesn't match, ignore it", ctrl_msg.magic);
- return NULL;
+ return;
}
switch (ctrl_msg.type) {
default:
dbg("unknown message type");
}
- return NULL;
}
/* receive the kernel user event message and do some sanity checks */
}
/* get user socket message */
- if (FD_ISSET(udevd_sock, &readfds)) {
- msg = get_udevd_msg();
- if (msg)
- msg_queue_insert(msg);
- }
+ if (FD_ISSET(udevd_sock, &readfds))
+ get_udevd_msg();
/* get kernel netlink message */
if (FD_ISSET(uevent_netlink_sock, &readfds)) {