execle(udev_bin, "udev", msg->subsystem, NULL, msg->envp);
dbg("exec of child failed");
_exit(1);
execle(udev_bin, "udev", msg->subsystem, NULL, msg->envp);
dbg("exec of child failed");
_exit(1);
/* copy environment buffer and reconstruct envp */
memcpy(msg->envbuf, usend_msg.envbuf, envbuf_size);
bufpos = 0;
/* copy environment buffer and reconstruct envp */
memcpy(msg->envbuf, usend_msg.envbuf, envbuf_size);
bufpos = 0;
if (strncmp(key, "SEQNUM=", 7) == 0)
msg->seqnum = strtoull(&key[7], NULL, 10);
}
if (strncmp(key, "SEQNUM=", 7) == 0)
msg->seqnum = strtoull(&key[7], NULL, 10);
}
fd = open( "/dev/null", O_RDWR );
if ( fd < 0 ) {
dbg("error opening /dev/null %s", strerror(errno));
fd = open( "/dev/null", O_RDWR );
if ( fd < 0 ) {
dbg("error opening /dev/null %s", strerror(errno));
}
retval = fcntl(pipefds[0], F_SETFL, O_NONBLOCK);
if (retval < 0) {
dbg("error fcntl on read pipe: %s", strerror(errno));
}
retval = fcntl(pipefds[0], F_SETFL, O_NONBLOCK);
if (retval < 0) {
dbg("error fcntl on read pipe: %s", strerror(errno));
}
retval = fcntl(pipefds[0], F_SETFD, FD_CLOEXEC);
if (retval < 0) {
dbg("error fcntl on read pipe: %s", strerror(errno));
}
retval = fcntl(pipefds[0], F_SETFD, FD_CLOEXEC);
if (retval < 0) {
dbg("error fcntl on read pipe: %s", strerror(errno));
}
retval = fcntl(pipefds[1], F_SETFL, O_NONBLOCK);
if (retval < 0) {
dbg("error fcntl on write pipe: %s", strerror(errno));
}
retval = fcntl(pipefds[1], F_SETFL, O_NONBLOCK);
if (retval < 0) {
dbg("error fcntl on write pipe: %s", strerror(errno));
}
retval = fcntl(pipefds[1], F_SETFD, FD_CLOEXEC);
if (retval < 0) {
dbg("error fcntl on write pipe: %s", strerror(errno));
}
retval = fcntl(pipefds[1], F_SETFD, FD_CLOEXEC);
if (retval < 0) {
dbg("error fcntl on write pipe: %s", strerror(errno));
udevsendsock = socket(AF_LOCAL, SOCK_DGRAM, 0);
if (udevsendsock == -1) {
dbg("error getting socket, exit");
udevsendsock = socket(AF_LOCAL, SOCK_DGRAM, 0);
if (udevsendsock == -1) {
dbg("error getting socket, exit");
}
/* the bind takes care of ensuring only one copy running */
retval = bind(udevsendsock, (struct sockaddr *) &saddr, addrlen);
if (retval < 0) {
dbg("bind failed, exit");
}
/* the bind takes care of ensuring only one copy running */
retval = bind(udevsendsock, (struct sockaddr *) &saddr, addrlen);
if (retval < 0) {
dbg("bind failed, exit");