chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'docs/udev.xml' of git://github.com/mfwitten/udev
[elogind.git]
/
udev
/
udevadm.c
diff --git
a/udev/udevadm.c
b/udev/udevadm.c
index 21b7f616c3e11c04995841ead06e0d3a59efad29..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,
@@
-101,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",
@@
-117,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);
}
@@
-146,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);
@@
-155,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;
@@
-171,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) {