chiark / gitweb /
[PATCH] Update the Gentoo udev.rules and udev.permissions files
[elogind.git] / udev.c
diff --git a/udev.c b/udev.c
index 0f01fa41d2a04e6b08cda306c7d61d6345c146de..f3fab18b29e3fe000f214f38d0cfd0dfc8ee88fa 100644 (file)
--- a/udev.c
+++ b/udev.c
@@ -26,6 +26,7 @@
 #include <errno.h>
 #include <ctype.h>
 #include <signal.h>
+#include <sysfs/libsysfs.h>
 
 #include "udev.h"
 #include "udev_version.h"
 #include "logging.h"
 #include "namedev.h"
 #include "udevdb.h"
-#include "libsysfs/libsysfs.h"
 
 /* global variables */
 char **main_argv;
 char **main_envp;
-unsigned char logname[42];
 
-int log_ok(void)
+#ifdef LOG
+unsigned char logname[42];
+void log_message (int level, const char *format, ...)
 {
-       return udev_log;
+       va_list args;
+
+       if (!udev_log)
+               return;
+
+       va_start(args, format);
+       vsyslog(level, format, args);
+       va_end(args);
 }
+#endif
 
 static void sig_handler(int signum)
 {
@@ -155,7 +164,7 @@ static int udev_hotplug(int argc, char **argv)
        namedev_init();
 
        if (strcmp(action, "add") == 0)
-               retval = udev_add_device(devpath, subsystem);
+               retval = udev_add_device(devpath, subsystem, 0);
 
        else if (strcmp(action, "remove") == 0)
                retval = udev_remove_device(devpath, subsystem);