diff options
author | Kay Sievers <kay.sievers@suse.de> | 2005-06-15 03:07:14 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@suse.de> | 2005-06-15 03:07:14 +0200 |
commit | 3632a3685883d3270145c59d5764de6246547943 (patch) | |
tree | 6b2a5d22d47f354f708df8f7fc733a4d20499942 /udevinitsend.c | |
parent | e5b7f7b83428cb50f165b49408c2f7559dcfefef (diff) |
udeveventrecorder: add small program that writes an event to disk
Used for debugging and event replay from initramfs.
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
Diffstat (limited to 'udevinitsend.c')
-rw-r--r-- | udevinitsend.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/udevinitsend.c b/udevinitsend.c index c7d56fc259..31a7109d1b 100644 --- a/udevinitsend.c +++ b/udevinitsend.c @@ -23,6 +23,7 @@ #include <stdio.h> #include <stddef.h> #include <stdio.h> +#include <stdlib.h> #include <unistd.h> #include <fcntl.h> #include <errno.h> @@ -38,16 +39,21 @@ #include "udev.h" #include "udev_version.h" #include "udevd.h" +#include "udev_utils.h" #include "logging.h" +static int log = 0; #ifdef USE_LOG -void log_message (int level, const char *format, ...) +void log_message (int priority, const char *format, ...) { va_list args; + if (priority > log) + return; + va_start(args, format); - vsyslog(level, format, args); + vsyslog(priority, format, args); va_end(args); } #endif @@ -164,6 +170,11 @@ int main(int argc, char *argv[], char *envp[]) int retval = 1; int disable_loop_detection = 0; int sock; + const char *env; + + env = getenv("UDEV_LOG"); + if (env) + log = log_priority(env); logging_init("udevinitsend"); dbg("version %s", UDEV_VERSION); |