chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
detect-virt: detect User-Mode Linux
[elogind.git]
/
src
/
udev
/
udevadm-trigger.c
diff --git
a/src/udev/udevadm-trigger.c
b/src/udev/udevadm-trigger.c
index 7735e4b67b8d1b535177634b2bbdf1274be79549..f472996965ae68e51d911fa3cf14485f0522c342 100644
(file)
--- a/
src/udev/udevadm-trigger.c
+++ b/
src/udev/udevadm-trigger.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (C) 2008-2009 Kay Sievers <kay
.sievers
@vrfy.org>
+ * Copyright (C) 2008-2009 Kay Sievers <kay@vrfy.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@
-48,7
+48,7
@@
static void exec_list(struct udev_enumerate *udev_enumerate, const char *action)
printf("%s\n", udev_list_entry_get_name(entry));
if (dry_run)
continue;
printf("%s\n", udev_list_entry_get_name(entry));
if (dry_run)
continue;
-
util_
strscpyl(filename, sizeof(filename), udev_list_entry_get_name(entry), "/uevent", NULL);
+ strscpyl(filename, sizeof(filename), udev_list_entry_get_name(entry), "/uevent", NULL);
fd = open(filename, O_WRONLY);
if (fd < 0)
continue;
fd = open(filename, O_WRONLY);
if (fd < 0)
continue;
@@
-62,7
+62,7
@@
static const char *keyval(const char *str, const char **val, char *buf, size_t s
{
char *pos;
{
char *pos;
-
util_
strscpy(buf, size,str);
+ strscpy(buf, size,str);
pos = strchr(buf, '=');
if (pos != NULL) {
pos[0] = 0;
pos = strchr(buf, '=');
if (pos != NULL) {
pos[0] = 0;
@@
-122,9
+122,9
@@
static int adm_trigger(struct udev *udev, int argc, char *argv[])
dry_run = 1;
break;
case 't':
dry_run = 1;
break;
case 't':
- if (str
cmp(optarg, "devices") == 0
) {
+ if (str
eq(optarg, "devices")
) {
device_type = TYPE_DEVICES;
device_type = TYPE_DEVICES;
- } else if (str
cmp(optarg, "subsystems") == 0
) {
+ } else if (str
eq(optarg, "subsystems")
) {
device_type = TYPE_SUBSYSTEMS;
} else {
log_error("unknown type --type=%s\n", optarg);
device_type = TYPE_SUBSYSTEMS;
} else {
log_error("unknown type --type=%s\n", optarg);
@@
-165,9
+165,9
@@
static int adm_trigger(struct udev *udev, int argc, char *argv[])
/* add sys dir if needed */
if (!startswith(optarg, "/sys"))
/* add sys dir if needed */
if (!startswith(optarg, "/sys"))
-
util_
strscpyl(path, sizeof(path), "/sys", optarg, NULL);
+ strscpyl(path, sizeof(path), "/sys", optarg, NULL);
else
else
-
util_
strscpy(path, sizeof(path), optarg);
+ strscpy(path, sizeof(path), optarg);
util_remove_trailing_chars(path, '/');
dev = udev_device_new_from_syspath(udev, path);
if (dev == NULL) {
util_remove_trailing_chars(path, '/');
dev = udev_device_new_from_syspath(udev, path);
if (dev == NULL) {
@@
-214,7
+214,7
@@
static int adm_trigger(struct udev *udev, int argc, char *argv[])
exec_list(udev_enumerate, action);
goto exit;
default:
exec_list(udev_enumerate, action);
goto exit;
default:
-
goto exit
;
+
assert_not_reached("device_type")
;
}
exit:
udev_enumerate_unref(udev_enumerate);
}
exit:
udev_enumerate_unref(udev_enumerate);