diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-08-11 20:13:38 +0200 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2014-08-12 14:14:22 -0400 |
commit | c597413eb3b84b24bc532331a4ab788c656ec0e2 (patch) | |
tree | 2aae2dca20cb0bbb8fde0c1d3dca0ed998b80597 /src/scsi_id | |
parent | ba33e83c5a8eb5ea54546438d2cfcde27fd59757 (diff) |
udev: never bypass our own logging framework and call vsyslog() directly from udev tools
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/scsi_id')
-rw-r--r-- | src/scsi_id/scsi_id.c | 12 | ||||
-rw-r--r-- | src/scsi_id/scsi_serial.c | 1 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/scsi_id/scsi_id.c b/src/scsi_id/scsi_id.c index 0ff95e566f..ad190552f7 100644 --- a/src/scsi_id/scsi_id.c +++ b/src/scsi_id/scsi_id.c @@ -29,7 +29,6 @@ #include <fcntl.h> #include <errno.h> #include <string.h> -#include <syslog.h> #include <ctype.h> #include <getopt.h> #include <sys/stat.h> @@ -59,7 +58,6 @@ static bool dev_specified = false; static char config_file[MAX_PATH_LEN] = "/etc/scsi_id.config"; static enum page_code default_page_code = PAGE_UNSPECIFIED; static int sg_version = 4; -static int debug = 0; static bool reformat_serial = false; static bool export = false; static char vendor_str[64]; @@ -74,7 +72,7 @@ static void log_fn(struct udev *udev, int priority, const char *file, int line, const char *fn, const char *format, va_list args) { - vsyslog(priority, format, args); + log_metav(priority, file, line, fn, format, args); } static void set_type(const char *from, char *to, size_t len) @@ -394,7 +392,10 @@ static int set_options(struct udev *udev, break; case 'v': - debug++; + log_set_target(LOG_TARGET_CONSOLE); + log_set_max_level(LOG_DEBUG); + udev_set_log_priority(udev, LOG_DEBUG); + log_open(); break; case 'V': @@ -587,11 +588,12 @@ int main(int argc, char **argv) int newargc; char **newargv = NULL; + log_open(); + udev = udev_new(); if (udev == NULL) goto exit; - log_open(); udev_set_log_fn(udev, log_fn); /* diff --git a/src/scsi_id/scsi_serial.c b/src/scsi_id/scsi_serial.c index c3f957db71..1806498503 100644 --- a/src/scsi_id/scsi_serial.c +++ b/src/scsi_id/scsi_serial.c @@ -30,7 +30,6 @@ #include <fcntl.h> #include <stdlib.h> #include <unistd.h> -#include <syslog.h> #include <time.h> #include <inttypes.h> #include <scsi/scsi.h> |