diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2009-06-09 22:47:48 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2009-06-09 22:47:48 +0200 |
commit | 9060b066d9e7aaca9795010ac5fff61018947f87 (patch) | |
tree | e79743bf9b075b10e2de962579e63a30ce36202e /udev | |
parent | 119f66fc36b4f5164fb4a9ece247938e97609a05 (diff) |
move syslog wrapper to libudev
Diffstat (limited to 'udev')
-rw-r--r-- | udev/udev.h | 17 | ||||
-rw-r--r-- | udev/udevadm.c | 4 | ||||
-rw-r--r-- | udev/udevd.c | 10 |
3 files changed, 7 insertions, 24 deletions
diff --git a/udev/udev.h b/udev/udev.h index 8926dee932..bd3686b28a 100644 --- a/udev/udev.h +++ b/udev/udev.h @@ -34,23 +34,6 @@ #define READ_END 0 #define WRITE_END 1 -static inline void logging_init(const char *program_name) -{ - openlog(program_name, LOG_PID | LOG_CONS, LOG_DAEMON); -} - -static inline void logging_msg(struct udev *udev, int priority, - const char *file, int line, const char *fn, - const char *format, va_list args) -{ - vsyslog(priority, format, args); -} - -static inline void logging_close(void) -{ - closelog(); -} - struct udev_event { struct udev *udev; struct udev_device *dev; diff --git a/udev/udevadm.c b/udev/udevadm.c index 072280a58e..99ac330082 100644 --- a/udev/udevadm.c +++ b/udev/udevadm.c @@ -138,7 +138,7 @@ int main(int argc, char *argv[]) if (udev == NULL) goto out; - logging_init("udevadm"); + udev_log_init("udevadm"); udev_set_log_fn(udev, log_fn); udev_selinux_init(udev); @@ -214,6 +214,6 @@ int main(int argc, char *argv[]) out: udev_selinux_exit(udev); udev_unref(udev); - logging_close(); + udev_log_close(); return rc; } diff --git a/udev/udevd.c b/udev/udevd.c index d63fa7f486..292f4374d7 100644 --- a/udev/udevd.c +++ b/udev/udevd.c @@ -213,8 +213,8 @@ static void worker_new(struct event *event) udev_ctrl_unref(udev_ctrl); close(pfd[FD_SIGNAL].fd); close(worker_watch[READ_END]); - logging_close(); - logging_init("udevd-work"); + udev_log_close(); + udev_log_init("udevd-work"); setpriority(PRIO_PROCESS, 0, UDEV_PRIORITY); /* set signal handlers */ @@ -288,7 +288,7 @@ static void worker_new(struct event *event) } udev_monitor_unref(worker_monitor); - logging_close(); + udev_log_close(); exit(0); } case -1: @@ -763,7 +763,7 @@ int main(int argc, char *argv[]) if (udev == NULL) goto exit; - logging_init("udevd"); + udev_log_init("udevd"); udev_set_log_fn(udev, log_fn); info(udev, "version %s\n", VERSION); udev_selinux_init(udev); @@ -1069,6 +1069,6 @@ exit: udev_monitor_unref(monitor); udev_selinux_exit(udev); udev_unref(udev); - logging_close(); + udev_log_close(); return rc; } |