chiark / gitweb /
[PATCH] 040 release
[elogind.git] / udevd.c
diff --git a/udevd.c b/udevd.c
index 380511d47eb24380d12812a141fe1cf2fc4c5345..9e0f71b58302ae7efa533f4c43ab2db4c3311a04 100644 (file)
--- a/udevd.c
+++ b/udevd.c
@@ -150,7 +150,7 @@ static void udev_run(struct hotplug_msg *msg)
                /* child */
                execle(udev_bin, "udev", msg->subsystem, NULL, env);
                dbg("exec of child failed");
-               exit(1);
+               _exit(1);
                break;
        case -1:
                dbg("fork of child failed");
@@ -177,7 +177,7 @@ static struct hotplug_msg *running_with_devpath(struct hotplug_msg *msg)
 }
 
 /* exec queue management routine executes the events and delays events for the same devpath */
-static void exec_queue_manager()
+static void exec_queue_manager(void)
 {
        struct hotplug_msg *loop_msg;
        struct hotplug_msg *tmp_msg;
@@ -207,7 +207,7 @@ static void msg_move_exec(struct hotplug_msg *msg)
 }
 
 /* msg queue management routine handles the timeouts and dispatches the events */
-static void msg_queue_manager()
+static void msg_queue_manager(void)
 {
        struct hotplug_msg *loop_msg;
        struct hotplug_msg *tmp_msg;
@@ -241,7 +241,7 @@ recheck:
        if (list_empty(&msg_list) == 0) {
                struct itimerval itv = {{0, 0}, {EVENT_TIMEOUT_SEC - msg_age, 0}};
                dbg("next event expires in %li seconds", EVENT_TIMEOUT_SEC - msg_age);
-               setitimer(ITIMER_REAL, &itv, 0);
+               setitimer(ITIMER_REAL, &itv, NULL);
        }
 }
 
@@ -309,7 +309,7 @@ skip:
        return;
 }
 
-asmlinkage static void sig_handler(int signum)
+static void asmlinkage sig_handler(int signum)
 {
        int rc;
 
@@ -366,11 +366,11 @@ static void udev_done(int pid)
        }
 }
 
-static void reap_kids()
+static void reap_kids(void)
 {
        /* reap all dead children */
        while(1) {
-               int pid = waitpid(-1, 0, WNOHANG);
+               int pid = waitpid(-1, NULL, WNOHANG);
                if ((pid == -1) || (pid == 0))
                        break;
                udev_done(pid);
@@ -380,7 +380,7 @@ static void reap_kids()
 /* just read everything from the pipe and clear the flag,
  * the useful flags were set in the signal handler
  */
-static void user_sighandler()
+static void user_sighandler(void)
 {
        int sig;
        while(1) {
@@ -403,7 +403,7 @@ int main(int argc, char *argv[])
        struct sigaction act;
        fd_set readfds;
 
-       init_logging("udevd");
+       logging_init("udevd");
        dbg("version %s", UDEV_VERSION);
 
        if (getuid() != 0) {
@@ -549,5 +549,6 @@ int main(int argc, char *argv[])
        }
 exit:
        close(ssock);
+       logging_close();
        exit(1);
 }