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 'python-systemd-reader'
[elogind.git]
/
src
/
udev
/
udevadm-trigger.c
diff --git
a/src/udev/udevadm-trigger.c
b/src/udev/udevadm-trigger.c
index a910121ecdd5b210aea888840827f384439b8bec..9624c66fba9e1a4b3f17cbc6ae50761ac94d6b5f 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);
@@
-164,10
+164,10
@@
static int adm_trigger(struct udev *udev, int argc, char *argv[])
struct udev_device *dev;
/* add sys dir if needed */
struct udev_device *dev;
/* add sys dir if needed */
- if (
strncmp(optarg, "/sys", strlen("/sys")) != 0
)
-
util_
strscpyl(path, sizeof(path), "/sys", optarg, NULL);
+ if (
!startswith(optarg, "/sys")
)
+ 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) {