- seqnum = getenv("SEQNUM");
- return seqnum;
-}
-
-static int build_hotplugmsg(struct hotplug_msg *msg, char *action,
- char *devpath, char *subsystem, int seqnum)
-{
- memset(msg, 0x00, sizeof(*msg));
- strfieldcpy(msg->magic, UDEV_MAGIC);
- msg->seqnum = seqnum;
- strncpy(msg->action, action, 8);
- strncpy(msg->devpath, devpath, 128);
- strncpy(msg->subsystem, subsystem, 16);
- return sizeof(struct hotplug_msg);
-}
-
-static int start_daemon(void)
-{
- pid_t pid;
- pid_t child_pid;
-
- pid = fork();
- switch (pid) {
- case 0:
- /* helper child */
- child_pid = fork();
- switch (child_pid) {
- case 0:
- /* daemon */
- setsid();
- chdir("/");
- execl(UDEVD_BIN, "udevd", NULL);
- dbg("exec of daemon failed");
- exit(1);
- case -1:
- dbg("fork of daemon failed");
- return -1;
- default:
- exit(0);
- }
- break;
- case -1:
- dbg("fork of helper failed");
- return -1;
- default:
- wait(NULL);
- }
- return 0;
+ va_start(args, format);
+ vsyslog(priority, format, args);
+ va_end(args);