summaryrefslogtreecommitdiff
path: root/src/udev
diff options
context:
space:
mode:
Diffstat (limited to 'src/udev')
-rw-r--r--src/udev/accelerometer/accelerometer.c11
-rw-r--r--src/udev/ata_id/ata_id.c10
-rw-r--r--src/udev/cdrom_id/cdrom_id.c11
-rw-r--r--src/udev/scsi_id/scsi_id.c11
-rw-r--r--src/udev/udev-event.c5
-rw-r--r--src/udev/udevadm.c2
-rw-r--r--src/udev/udevd.c9
7 files changed, 3 insertions, 56 deletions
diff --git a/src/udev/accelerometer/accelerometer.c b/src/udev/accelerometer/accelerometer.c
index 4513bc63c2..dd4b7dc8a2 100644
--- a/src/udev/accelerometer/accelerometer.c
+++ b/src/udev/accelerometer/accelerometer.c
@@ -69,14 +69,6 @@
#define LONG(x) ((x)/BITS_PER_LONG)
#define test_bit(bit, array) ((array[LONG(bit)] >> OFF(bit)) & 1)
-_printf_(6,0)
-static void log_fn(struct udev *udev, int priority,
- const char *file, int line, const char *fn,
- const char *format, va_list args)
-{
- log_metav(priority, file, line, fn, format, args);
-}
-
typedef enum {
ORIENTATION_UNDEFINED,
ORIENTATION_NORMAL,
@@ -233,8 +225,6 @@ int main (int argc, char** argv)
if (udev == NULL)
return 1;
- udev_set_log_fn(udev, log_fn);
-
/* CLI argument parsing */
while (1) {
int option;
@@ -247,7 +237,6 @@ int main (int argc, char** argv)
case 'd':
log_set_target(LOG_TARGET_CONSOLE);
log_set_max_level(LOG_DEBUG);
- udev_set_log_priority(udev, LOG_DEBUG);
log_open();
break;
case 'h':
diff --git a/src/udev/ata_id/ata_id.c b/src/udev/ata_id/ata_id.c
index bfde57223a..0d56f9b09d 100644
--- a/src/udev/ata_id/ata_id.c
+++ b/src/udev/ata_id/ata_id.c
@@ -405,14 +405,6 @@ out:
return ret;
}
-_printf_(6,0)
-static void log_fn(struct udev *udev, int priority,
- const char *file, int line, const char *fn,
- const char *format, va_list args)
-{
- log_metav(priority, file, line, fn, format, args);
-}
-
int main(int argc, char *argv[])
{
struct udev *udev;
@@ -442,8 +434,6 @@ int main(int argc, char *argv[])
if (udev == NULL)
goto exit;
- udev_set_log_fn(udev, log_fn);
-
while (1) {
int option;
diff --git a/src/udev/cdrom_id/cdrom_id.c b/src/udev/cdrom_id/cdrom_id.c
index 5fe3fb535b..48ceb657e0 100644
--- a/src/udev/cdrom_id/cdrom_id.c
+++ b/src/udev/cdrom_id/cdrom_id.c
@@ -37,14 +37,6 @@
#include "libudev.h"
#include "libudev-private.h"
-_printf_(6,0)
-static void log_fn(struct udev *udev, int priority,
- const char *file, int line, const char *fn,
- const char *format, va_list args)
-{
- log_metav(priority, file, line, fn, format, args);
-}
-
/* device info */
static unsigned int cd_cd_rom;
static unsigned int cd_cd_r;
@@ -875,8 +867,6 @@ int main(int argc, char *argv[])
if (udev == NULL)
goto exit;
- udev_set_log_fn(udev, log_fn);
-
while (1) {
int option;
@@ -897,7 +887,6 @@ int main(int argc, char *argv[])
case 'd':
log_set_target(LOG_TARGET_CONSOLE);
log_set_max_level(LOG_DEBUG);
- udev_set_log_priority(udev, LOG_DEBUG);
log_open();
break;
case 'h':
diff --git a/src/udev/scsi_id/scsi_id.c b/src/udev/scsi_id/scsi_id.c
index 48c6cf7dba..1c269084aa 100644
--- a/src/udev/scsi_id/scsi_id.c
+++ b/src/udev/scsi_id/scsi_id.c
@@ -63,14 +63,6 @@ static char model_enc_str[256];
static char revision_str[16];
static char type_str[16];
-_printf_(6,0)
-static void log_fn(struct udev *udev, int priority,
- const char *file, int line, const char *fn,
- const char *format, va_list args)
-{
- log_metav(priority, file, line, fn, format, args);
-}
-
static void set_type(const char *from, char *to, size_t len)
{
int type_num;
@@ -390,7 +382,6 @@ static int set_options(struct udev *udev,
case 'v':
log_set_target(LOG_TARGET_CONSOLE);
log_set_max_level(LOG_DEBUG);
- udev_set_log_priority(udev, LOG_DEBUG);
log_open();
break;
@@ -591,8 +582,6 @@ int main(int argc, char **argv)
if (udev == NULL)
goto exit;
- udev_set_log_fn(udev, log_fn);
-
/*
* Get config file options.
*/
diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c
index 30a6708901..5585b78cc3 100644
--- a/src/udev/udev-event.c
+++ b/src/udev/udev-event.c
@@ -676,7 +676,6 @@ int udev_event_spawn(struct udev_event *event,
usec_t timeout_warn_usec,
const char *cmd, char **envp, const sigset_t *sigmask,
char *result, size_t ressize) {
- struct udev *udev = event->udev;
int outpipe[2] = {-1, -1};
int errpipe[2] = {-1, -1};
pid_t pid;
@@ -689,14 +688,14 @@ int udev_event_spawn(struct udev_event *event,
udev_build_argv(event->udev, arg, NULL, argv);
/* pipes from child to parent */
- if (result != NULL || udev_get_log_priority(udev) >= LOG_INFO) {
+ if (result != NULL || log_get_max_level() >= LOG_INFO) {
if (pipe2(outpipe, O_NONBLOCK) != 0) {
err = -errno;
log_error("pipe failed: %m");
goto out;
}
}
- if (udev_get_log_priority(udev) >= LOG_INFO) {
+ if (log_get_max_level() >= LOG_INFO) {
if (pipe2(errpipe, O_NONBLOCK) != 0) {
err = -errno;
log_error("pipe failed: %m");
diff --git a/src/udev/udevadm.c b/src/udev/udevadm.c
index 7026c50d2b..daa9387bf1 100644
--- a/src/udev/udevadm.c
+++ b/src/udev/udevadm.c
@@ -98,7 +98,6 @@ int main(int argc, char *argv[]) {
log_parse_environment();
log_open();
- udev_set_log_fn(udev, udev_main_log);
mac_selinux_init("/dev");
while ((c = getopt_long(argc, argv, "+dhV", options, NULL)) >= 0)
@@ -106,7 +105,6 @@ int main(int argc, char *argv[]) {
case 'd':
log_set_max_level(LOG_DEBUG);
- udev_set_log_priority(udev, LOG_DEBUG);
break;
case 'h':
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index a040529e6f..e03297de5b 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -644,7 +644,6 @@ static struct udev_ctrl_connection *handle_ctrl_msg(struct udev_ctrl *uctrl) {
if (i >= 0) {
log_debug("udevd message (SET_LOG_LEVEL) received, log_priority=%i", i);
log_set_max_level(i);
- udev_set_log_priority(udev, i);
worker_kill(udev);
}
@@ -984,7 +983,6 @@ static void kernel_cmdline_options(struct udev *udev) {
prio = util_log_priority(value);
log_set_max_level(prio);
- udev_set_log_priority(udev, prio);
} else if ((value = startswith(opt, "udev.children-max="))) {
r = safe_atoi(value, &arg_children_max);
if (r < 0)
@@ -1120,19 +1118,14 @@ int main(int argc, char *argv[]) {
log_parse_environment();
log_open();
- udev_set_log_fn(udev, udev_main_log);
- log_set_max_level(udev_get_log_priority(udev));
-
r = parse_argv(argc, argv);
if (r <= 0)
goto exit;
kernel_cmdline_options(udev);
- if (arg_debug) {
+ if (arg_debug)
log_set_max_level(LOG_DEBUG);
- udev_set_log_priority(udev, LOG_DEBUG);
- }
if (getuid() != 0) {
log_error("root privileges required");