-#include "udevd.h"
-
-static int uevent_netlink_sock = -1;
-static int udev_monitor_sock = -1;
-static volatile int udev_exit;
-
-static int init_udev_monitor_socket(void)
-{
- struct sockaddr_un saddr;
- socklen_t addrlen;
- int retval;
-
- memset(&saddr, 0x00, sizeof(saddr));
- saddr.sun_family = AF_LOCAL;
- /* use abstract namespace for socket path */
- strcpy(&saddr.sun_path[1], "/org/kernel/udev/monitor");
- addrlen = offsetof(struct sockaddr_un, sun_path) + 1 + strlen(&saddr.sun_path[1]);
-
- udev_monitor_sock = socket(AF_LOCAL, SOCK_DGRAM, 0);
- if (udev_monitor_sock == -1) {
- fprintf(stderr, "error getting socket: %s\n", strerror(errno));
- return -1;
- }
-
- /* the bind takes care of ensuring only one copy running */
- retval = bind(udev_monitor_sock, (struct sockaddr *) &saddr, addrlen);
- if (retval < 0) {
- fprintf(stderr, "bind failed: %s\n", strerror(errno));
- close(udev_monitor_sock);
- udev_monitor_sock = -1;
- return -1;
- }
-
- return 0;
-}
-
-static int init_uevent_netlink_sock(void)
-{
- struct sockaddr_nl snl;
- int retval;