X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=udev.c;h=f3fab18b29e3fe000f214f38d0cfd0dfc8ee88fa;hp=0f01fa41d2a04e6b08cda306c7d61d6345c146de;hb=e59d338c9685985fa9aed890cbb8bf3bb17160ee;hpb=f8911dbb0404902502085c7bb204f2f9c5bc1b9c diff --git a/udev.c b/udev.c index 0f01fa41d..f3fab18b2 100644 --- a/udev.c +++ b/udev.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "udev.h" #include "udev_version.h" @@ -33,17 +34,25 @@ #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);