mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-10-31 07:51:08 +03:00
volume_id: use udev-provided log-level
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
This commit is contained in:
parent
995aec8759
commit
c2401132bf
@ -33,7 +33,7 @@ override CFLAGS+=-D_FILE_OFFSET_BITS=64
|
||||
VOLUME_ID_BASE=volume_id
|
||||
include $(VOLUME_ID_BASE)/Makefile.inc
|
||||
|
||||
OBJS = udev_volume_id.o $(VOLUME_ID_OBJS) $(SYSFS)
|
||||
OBJS = udev_volume_id.o $(VOLUME_ID_OBJS) ../../udev.a
|
||||
HEADERS = $(VOLUME_ID_HEADERS)
|
||||
|
||||
$(OBJS): $(HEADERS)
|
||||
|
@ -40,12 +40,26 @@
|
||||
#define BLKGETSIZE64 _IOR(0x12,114,size_t)
|
||||
|
||||
#ifdef USE_LOG
|
||||
void log_message(int level, const char *format, ...)
|
||||
void log_message(int priority, const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
static int udev_log = -1;
|
||||
|
||||
if (udev_log == -1) {
|
||||
const char *value;
|
||||
|
||||
value = getenv("UDEV_LOG");
|
||||
if (value)
|
||||
udev_log = log_priority(value);
|
||||
else
|
||||
udev_log = LOG_ERR;
|
||||
}
|
||||
|
||||
if (priority > udev_log)
|
||||
return;
|
||||
|
||||
va_start(args, format);
|
||||
vsyslog(level, format, args);
|
||||
vsyslog(priority, format, args);
|
||||
va_end(args);
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user