chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
udevd: always use udevd[] log prefix
[elogind.git]
/
udev
/
udevadm.c
diff --git
a/udev/udevadm.c
b/udev/udevadm.c
index 3d94215ba97d04524516eca820354304973f5262..2a2915891797dcba2b17940ed7db701722b7e7e4 100644
(file)
--- a/
udev/udevadm.c
+++ b/
udev/udevadm.c
@@
-25,7
+25,7
@@
#include "udev.h"
#include "udev.h"
-static
int
debug;
+static
bool
debug;
static void log_fn(struct udev *udev, int priority,
const char *file, int line, const char *fn,
static void log_fn(struct udev *udev, int priority,
const char *file, int line, const char *fn,
@@
-35,8
+35,11
@@
static void log_fn(struct udev *udev, int priority,
fprintf(stderr, "%s: ", fn);
vfprintf(stderr, format, args);
} else {
fprintf(stderr, "%s: ", fn);
vfprintf(stderr, format, args);
} else {
- if (priority <= LOG_ERR)
- vfprintf(stderr, format, args);
+ va_list args2;
+
+ va_copy(args2, args);
+ vfprintf(stderr, format, args2);
+ va_end(args2);
vsyslog(priority, format, args);
}
}
vsyslog(priority, format, args);
}
}
@@
-98,7
+101,7
@@
static const struct command cmds[] = {
.name = "test",
.cmd = udevadm_test,
.help = "simulation run",
.name = "test",
.cmd = udevadm_test,
.help = "simulation run",
- .debug =
1
,
+ .debug =
true
,
},
{
.name = "version",
},
{
.name = "version",
@@
-114,7
+117,7
@@
static const struct command cmds[] = {
static int run_command(struct udev *udev, const struct command *cmd, int argc, char *argv[])
{
if (cmd->debug) {
static int run_command(struct udev *udev, const struct command *cmd, int argc, char *argv[])
{
if (cmd->debug) {
- debug =
1
;
+ debug =
true
;
if (udev_get_log_priority(udev) < LOG_INFO)
udev_set_log_priority(udev, LOG_INFO);
}
if (udev_get_log_priority(udev) < LOG_INFO)
udev_set_log_priority(udev, LOG_INFO);
}
@@
-143,7
+146,7
@@
int main(int argc, char *argv[])
udev_set_log_fn(udev, log_fn);
udev_selinux_init(udev);
udev_set_log_fn(udev, log_fn);
udev_selinux_init(udev);
-
while (1
) {
+
for (;;
) {
int option;
option = getopt_long(argc, argv, "+dhV", options, NULL);
int option;
option = getopt_long(argc, argv, "+dhV", options, NULL);
@@
-152,7
+155,7
@@
int main(int argc, char *argv[])
switch (option) {
case 'd':
switch (option) {
case 'd':
- debug =
1
;
+ debug =
true
;
if (udev_get_log_priority(udev) < LOG_INFO)
udev_set_log_priority(udev, LOG_INFO);
break;
if (udev_get_log_priority(udev) < LOG_INFO)
udev_set_log_priority(udev, LOG_INFO);
break;
@@
-168,6
+171,8
@@
int main(int argc, char *argv[])
}
command = argv[optind];
}
command = argv[optind];
+ info(udev, "runtime dir '%s'\n", udev_get_run_path(udev));
+
if (command != NULL)
for (i = 0; cmds[i].cmd != NULL; i++) {
if (strcmp(cmds[i].name, command) == 0) {
if (command != NULL)
for (i = 0; cmds[i].cmd != NULL; i++) {
if (strcmp(cmds[i].name, command) == 0) {