chiark / gitweb /
[PATCH] 016_bk mark
[elogind.git] / udevsend.c
index 0ddc6839def3d63c2fbc74201dbbfe4395b9fb0c..d3c74dd46a4e9f5b9248759b2a711888585e2222 100644 (file)
  */
 
 #include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/msg.h>
+#include <sys/socket.h>
+#include <sys/wait.h>
+#include <sys/un.h>
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 #include <time.h>
-#include <wait.h>
-#include <sys/socket.h>
-#include <sys/un.h>
 
 #include "udev.h"
 #include "udev_version.h"
 #include "udevd.h"
 #include "logging.h"
 
+unsigned char logname[42];
 
 static inline char *get_action(void)
 {
@@ -126,6 +125,10 @@ int main(int argc, char* argv[])
        int sock;
        struct sockaddr_un saddr;
 
+#ifdef DEBUG
+       init_logging("udevsend");
+#endif
+
        subsystem = argv[1];
        if (subsystem == NULL) {
                dbg("no subsystem");
@@ -162,7 +165,7 @@ int main(int argc, char* argv[])
        strcpy(saddr.sun_path, UDEVD_SOCK);
 
        /* try to connect, if it fails start daemon */
-       retval = connect(sock, &saddr, sizeof(saddr));
+       retval = connect(sock, (struct sockaddr *) &saddr, sizeof(saddr));
        if (retval != -1) {
                goto send;
        } else {
@@ -181,7 +184,7 @@ int main(int argc, char* argv[])
        tspec.tv_nsec = 100000000;  /* 100 millisec */
        loop = UDEVSEND_CONNECT_RETRY;
        while (loop--) {
-               retval = connect(sock, &saddr, sizeof(saddr));
+               retval = connect(sock, (struct sockaddr *) &saddr, sizeof(saddr));
                if (retval != -1)
                        goto send;
                else