chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
b05105f
)
use streq instead of strcmp
author
Thomas Hindoe Paaboel Andersen
<phomes@gmail.com>
Wed, 13 Feb 2013 17:13:22 +0000
(18:13 +0100)
committer
Thomas Hindoe Paaboel Andersen
<phomes@gmail.com>
Wed, 13 Feb 2013 17:14:20 +0000
(18:14 +0100)
22 files changed:
src/boot/boot-loader.c
patch
|
blob
|
history
src/journal/test-journal-syslog.c
patch
|
blob
|
history
src/libudev/libudev-monitor.c
patch
|
blob
|
history
src/libudev/libudev-queue.c
patch
|
blob
|
history
src/libudev/libudev-util.c
patch
|
blob
|
history
src/libudev/libudev.c
patch
|
blob
|
history
src/test/test-udev.c
patch
|
blob
|
history
src/udev/accelerometer/accelerometer.c
patch
|
blob
|
history
src/udev/collect/collect.c
patch
|
blob
|
history
src/udev/scsi_id/scsi_id.c
patch
|
blob
|
history
src/udev/udev-builtin-kmod.c
patch
|
blob
|
history
src/udev/udev-builtin-net_id.c
patch
|
blob
|
history
src/udev/udev-builtin-path_id.c
patch
|
blob
|
history
src/udev/udev-builtin-usb_id.c
patch
|
blob
|
history
src/udev/udev-builtin.c
patch
|
blob
|
history
src/udev/udev-event.c
patch
|
blob
|
history
src/udev/udev-node.c
patch
|
blob
|
history
src/udev/udevadm-info.c
patch
|
blob
|
history
src/udev/udevadm-test.c
patch
|
blob
|
history
src/udev/udevadm-trigger.c
patch
|
blob
|
history
src/udev/udevadm.c
patch
|
blob
|
history
src/udev/udevd.c
patch
|
blob
|
history
diff --git
a/src/boot/boot-loader.c
b/src/boot/boot-loader.c
index d1a8b0320b511eec322891df7b03aa39fc0929a2..d44fdb3aef652f1a03cb8a9d0186ccb0a2509851 100644
(file)
--- a/
src/boot/boot-loader.c
+++ b/
src/boot/boot-loader.c
@@
-121,7
+121,7
@@
int boot_loader_find_active_entry(struct boot_info *info, const char *loader_act
return -ENOMEM;
for (i = 0; i < info->loader_entries_count; i++) {
return -ENOMEM;
for (i = 0; i < info->loader_entries_count; i++) {
- if (str
cmp(fn, info->loader_entries[i].path) == 0
) {
+ if (str
eq(fn, info->loader_entries[i].path)
) {
info->loader_entry_active = i;
break;
}
info->loader_entry_active = i;
break;
}
diff --git
a/src/journal/test-journal-syslog.c
b/src/journal/test-journal-syslog.c
index 3ae8633f22446abb0b789c7df6aa2db18c9eb290..5cf940733bbf2d79477d566c00b3209c35c9fbf6 100644
(file)
--- a/
src/journal/test-journal-syslog.c
+++ b/
src/journal/test-journal-syslog.c
@@
-31,8
+31,8
@@
static void test_syslog_parse_identifier(const char* str,
ret2 = syslog_parse_identifier(&buf, &ident2, &pid2);
assert(ret == ret2);
ret2 = syslog_parse_identifier(&buf, &ident2, &pid2);
assert(ret == ret2);
- assert(ident==ident2 ||
!strcmp
(ident, ident2));
- assert(pid==pid2 ||
!strcmp
(pid, pid2));
+ assert(ident==ident2 ||
streq
(ident, ident2));
+ assert(pid==pid2 ||
streq
(pid, pid2));
}
int main(void) {
}
int main(void) {
diff --git
a/src/libudev/libudev-monitor.c
b/src/libudev/libudev-monitor.c
index b02ea8808cf949a41de9caca803dba7e7b859f01..0212792552f5523097058ef248d42a7ef82d720d 100644
(file)
--- a/
src/libudev/libudev-monitor.c
+++ b/
src/libudev/libudev-monitor.c
@@
-115,9
+115,9
@@
struct udev_monitor *udev_monitor_new_from_netlink_fd(struct udev *udev, const c
if (name == NULL)
group = UDEV_MONITOR_NONE;
if (name == NULL)
group = UDEV_MONITOR_NONE;
- else if (str
cmp(name, "udev") == 0
)
+ else if (str
eq(name, "udev")
)
group = UDEV_MONITOR_UDEV;
group = UDEV_MONITOR_UDEV;
- else if (str
cmp(name, "kernel") == 0
)
+ else if (str
eq(name, "kernel")
)
group = UDEV_MONITOR_KERNEL;
else
return NULL;
group = UDEV_MONITOR_KERNEL;
else
return NULL;
@@
-467,7
+467,7
@@
static int passes_filter(struct udev_monitor *udev_monitor, struct udev_device *
const char *devtype;
const char *ddevtype;
const char *devtype;
const char *ddevtype;
- if (
strcmp(dsubsys, subsys) != 0
)
+ if (
!streq(dsubsys, subsys)
)
continue;
devtype = udev_list_entry_get_value(list_entry);
continue;
devtype = udev_list_entry_get_value(list_entry);
@@
-476,7
+476,7
@@
static int passes_filter(struct udev_monitor *udev_monitor, struct udev_device *
ddevtype = udev_device_get_devtype(udev_device);
if (ddevtype == NULL)
continue;
ddevtype = udev_device_get_devtype(udev_device);
if (ddevtype == NULL)
continue;
- if (str
cmp(ddevtype, devtype) == 0
)
+ if (str
eq(ddevtype, devtype)
)
goto tag;
}
return 0;
goto tag;
}
return 0;
diff --git
a/src/libudev/libudev-queue.c
b/src/libudev/libudev-queue.c
index bfb48073831bb75cd46266df043091f95b840640..0dd20313d9fe892dad73a1256b83041bd55bc002 100644
(file)
--- a/
src/libudev/libudev-queue.c
+++ b/
src/libudev/libudev-queue.c
@@
-467,7
+467,7
@@
_public_ struct udev_list_entry *udev_queue_get_queued_list_entry(struct udev_qu
udev_list_entry_add(&udev_queue->queue_list, syspath, seqnum_str);
} else {
udev_list_entry_foreach(list_entry, udev_list_get_entry(&udev_queue->queue_list)) {
udev_list_entry_add(&udev_queue->queue_list, syspath, seqnum_str);
} else {
udev_list_entry_foreach(list_entry, udev_list_get_entry(&udev_queue->queue_list)) {
- if (str
cmp(seqnum_str, udev_list_entry_get_value(list_entry)) == 0
) {
+ if (str
eq(seqnum_str, udev_list_entry_get_value(list_entry))
) {
udev_list_entry_delete(list_entry);
break;
}
udev_list_entry_delete(list_entry);
break;
}
diff --git
a/src/libudev/libudev-util.c
b/src/libudev/libudev-util.c
index 2eb7907063bc41f098d27fa4199fa7b4cff6ae97..62b7e56c05c7e463663f0302c4105055746fa3ba 100644
(file)
--- a/
src/libudev/libudev-util.c
+++ b/
src/libudev/libudev-util.c
@@
-83,7
+83,7
@@
uid_t util_lookup_user(struct udev *udev, const char *user)
size_t buflen = sysconf(_SC_GETPW_R_SIZE_MAX);
char *buf = alloca(buflen);
size_t buflen = sysconf(_SC_GETPW_R_SIZE_MAX);
char *buf = alloca(buflen);
- if (str
cmp(user, "root") == 0
)
+ if (str
eq(user, "root")
)
return 0;
uid = strtoul(user, &endptr, 10);
if (endptr[0] == '\0')
return 0;
uid = strtoul(user, &endptr, 10);
if (endptr[0] == '\0')
@@
-108,7
+108,7
@@
gid_t util_lookup_group(struct udev *udev, const char *group)
size_t buflen = sysconf(_SC_GETPW_R_SIZE_MAX);
char *buf = NULL;
size_t buflen = sysconf(_SC_GETPW_R_SIZE_MAX);
char *buf = NULL;
- if (str
cmp(group, "root") == 0
)
+ if (str
eq(group, "root")
)
return 0;
gid = strtoul(group, &endptr, 10);
if (endptr[0] == '\0')
return 0;
gid = strtoul(group, &endptr, 10);
if (endptr[0] == '\0')
diff --git
a/src/libudev/libudev.c
b/src/libudev/libudev.c
index d860ebc08037b7fc0c88b339636f558a33193176..208039a1b2e679971bcd004554bb0cc9ead3c420 100644
(file)
--- a/
src/libudev/libudev.c
+++ b/
src/libudev/libudev.c
@@
-191,7
+191,7
@@
_public_ struct udev *udev_new(void)
val++;
}
val++;
}
- if (str
cmp(key, "udev_log") == 0
) {
+ if (str
eq(key, "udev_log")
) {
udev_set_log_priority(udev, util_log_priority(val));
continue;
}
udev_set_log_priority(udev, util_log_priority(val));
continue;
}
diff --git
a/src/test/test-udev.c
b/src/test/test-udev.c
index aee87f753d03e156651189070dd12ce2bcb80a57..52b61b42061c73c79d5dddb3eb5007aeb402185a 100644
(file)
--- a/
src/test/test-udev.c
+++ b/
src/test/test-udev.c
@@
-140,12
+140,12
@@
int main(int argc, char *argv[])
if (udev_device_get_devnode(dev) != NULL) {
mode_t mode = 0600;
if (udev_device_get_devnode(dev) != NULL) {
mode_t mode = 0600;
- if (str
cmp(udev_device_get_subsystem(dev), "block") == 0
)
+ if (str
eq(udev_device_get_subsystem(dev), "block")
)
mode |= S_IFBLK;
else
mode |= S_IFCHR;
mode |= S_IFBLK;
else
mode |= S_IFCHR;
- if (
strcmp(action, "remove") != 0
) {
+ if (
!streq(action, "remove")
) {
mkdir_parents_label(udev_device_get_devnode(dev), 0755);
mknod(udev_device_get_devnode(dev), mode, udev_device_get_devnum(dev));
} else {
mkdir_parents_label(udev_device_get_devnode(dev), 0755);
mknod(udev_device_get_devnode(dev), mode, udev_device_get_devnum(dev));
} else {
diff --git
a/src/udev/accelerometer/accelerometer.c
b/src/udev/accelerometer/accelerometer.c
index 2fea3889c777712ac58ebf244b5738da867a6edc..f50db71a761850c7ed06fa10b98173ff158a74e5 100644
(file)
--- a/
src/udev/accelerometer/accelerometer.c
+++ b/
src/udev/accelerometer/accelerometer.c
@@
-122,7
+122,7
@@
string_to_orientation (const char *orientation)
if (orientation == NULL)
return ORIENTATION_UNDEFINED;
for (i = 0; orientations[i] != NULL; i++) {
if (orientation == NULL)
return ORIENTATION_UNDEFINED;
for (i = 0; orientations[i] != NULL; i++) {
- if (str
cmp (orientation, orientations[i]) == 0
)
+ if (str
eq (orientation, orientations[i])
)
return i;
}
return ORIENTATION_UNDEFINED;
return i;
}
return ORIENTATION_UNDEFINED;
diff --git
a/src/udev/collect/collect.c
b/src/udev/collect/collect.c
index f594814dbec261f7c7e22cd53401b02cddab8270..7850cfa4187ef0394260ff0ceac190faee55ee82 100644
(file)
--- a/
src/udev/collect/collect.c
+++ b/
src/udev/collect/collect.c
@@
-213,7
+213,7
@@
static void invite(char *us)
udev_list_node_foreach(him_node, &bunch) {
struct _mate *him = node_to_mate(him_node);
udev_list_node_foreach(him_node, &bunch) {
struct _mate *him = node_to_mate(him_node);
- if (
!strcmp
(him->name, us)) {
+ if (
streq
(him->name, us)) {
him->state = STATE_CONFIRMED;
who = him;
}
him->state = STATE_CONFIRMED;
who = him;
}
@@
-241,7
+241,7
@@
static void reject(char *us)
udev_list_node_foreach(him_node, &bunch) {
struct _mate *him = node_to_mate(him_node);
udev_list_node_foreach(him_node, &bunch) {
struct _mate *him = node_to_mate(him_node);
- if (
!strcmp
(him->name, us)) {
+ if (
streq
(him->name, us)) {
him->state = STATE_NONE;
who = him;
}
him->state = STATE_NONE;
who = him;
}
@@
-434,7
+434,7
@@
int main(int argc, char **argv)
udev_list_node_foreach(him_node, &bunch) {
struct _mate *him = node_to_mate(him_node);
udev_list_node_foreach(him_node, &bunch) {
struct _mate *him = node_to_mate(him_node);
- if (
!strcmp
(him->name, argv[i]))
+ if (
streq
(him->name, argv[i]))
who = him;
}
if (!who) {
who = him;
}
if (!who) {
diff --git
a/src/udev/scsi_id/scsi_id.c
b/src/udev/scsi_id/scsi_id.c
index dcf03eefac6faa06298959b4e9cb07802b00a9f6..ab7c54c3f2ae78a7d9a714186cd8806bb56ce161 100644
(file)
--- a/
src/udev/scsi_id/scsi_id.c
+++ b/
src/udev/scsi_id/scsi_id.c
@@
-372,11
+372,11
@@
static int set_options(struct udev *udev,
exit(0);
case 'p':
exit(0);
case 'p':
- if (str
cmp(optarg, "0x80") == 0
) {
+ if (str
eq(optarg, "0x80")
) {
default_page_code = PAGE_80;
default_page_code = PAGE_80;
- } else if (str
cmp(optarg, "0x83") == 0
) {
+ } else if (str
eq(optarg, "0x83")
) {
default_page_code = PAGE_83;
default_page_code = PAGE_83;
- } else if (str
cmp(optarg, "pre-spc3-83") == 0
) {
+ } else if (str
eq(optarg, "pre-spc3-83")
) {
default_page_code = PAGE_83_PRE_SPC3;
} else {
log_error("Unknown page code '%s'\n", optarg);
default_page_code = PAGE_83_PRE_SPC3;
} else {
log_error("Unknown page code '%s'\n", optarg);
@@
-449,11
+449,11
@@
static int per_dev_options(struct udev *udev,
break;
case 'p':
break;
case 'p':
- if (str
cmp(optarg, "0x80") == 0
) {
+ if (str
eq(optarg, "0x80")
) {
*page_code = PAGE_80;
*page_code = PAGE_80;
- } else if (str
cmp(optarg, "0x83") == 0
) {
+ } else if (str
eq(optarg, "0x83")
) {
*page_code = PAGE_83;
*page_code = PAGE_83;
- } else if (str
cmp(optarg, "pre-spc3-83") == 0
) {
+ } else if (str
eq(optarg, "pre-spc3-83")
) {
*page_code = PAGE_83_PRE_SPC3;
} else {
log_error("Unknown page code '%s'\n", optarg);
*page_code = PAGE_83_PRE_SPC3;
} else {
log_error("Unknown page code '%s'\n", optarg);
diff --git
a/src/udev/udev-builtin-kmod.c
b/src/udev/udev-builtin-kmod.c
index 17aca2944d5879c4fc75d7f2d1985ad57db9ded5..fc28121267037a007de08195735c730ddc3d55dc 100644
(file)
--- a/
src/udev/udev-builtin-kmod.c
+++ b/
src/udev/udev-builtin-kmod.c
@@
-78,7
+78,7
@@
static int builtin_kmod(struct udev_device *dev, int argc, char *argv[], bool te
if (!ctx)
return 0;
if (!ctx)
return 0;
- if (argc < 3 ||
strcmp
(argv[1], "load")) {
+ if (argc < 3 ||
!streq
(argv[1], "load")) {
log_error("expect: %s load <module>\n", argv[0]);
return EXIT_FAILURE;
}
log_error("expect: %s load <module>\n", argv[0]);
return EXIT_FAILURE;
}
diff --git
a/src/udev/udev-builtin-net_id.c
b/src/udev/udev-builtin-net_id.c
index c55c34d614037c53136350118bf1ef282b73326b..57674bf2785b51c5f96a39eaa8939f514e5d2161 100644
(file)
--- a/
src/udev/udev-builtin-net_id.c
+++ b/
src/udev/udev-builtin-net_id.c
@@
-413,7
+413,7
@@
static int builtin_net_id(struct udev_device *dev, int argc, char *argv[], bool
p = udev_device_get_sysattr_value(dev, "iflink");
if (!p)
return EXIT_FAILURE;
p = udev_device_get_sysattr_value(dev, "iflink");
if (!p)
return EXIT_FAILURE;
- if (
strcmp(s, p) != 0
)
+ if (
!streq(s, p)
)
return 0;
devtype = udev_device_get_devtype(dev);
return 0;
devtype = udev_device_get_devtype(dev);
diff --git
a/src/udev/udev-builtin-path_id.c
b/src/udev/udev-builtin-path_id.c
index d6b3736aeee6619346c90c4116def99d982cdb1b..da0273197bded6645cc0e4ceffe1b3ef1c6c134f 100644
(file)
--- a/
src/udev/udev-builtin-path_id.c
+++ b/
src/udev/udev-builtin-path_id.c
@@
-83,7
+83,7
@@
static struct udev_device *skip_subsystem(struct udev_device *dev, const char *s
const char *subsystem;
subsystem = udev_device_get_subsystem(parent);
const char *subsystem;
subsystem = udev_device_get_subsystem(parent);
- if (subsystem == NULL ||
strcmp(subsystem, subsys) != 0
)
+ if (subsystem == NULL ||
!streq(subsystem, subsys)
)
break;
dev = parent;
parent = udev_device_get_parent(parent);
break;
dev = parent;
parent = udev_device_get_parent(parent);
@@
-345,7
+345,7
@@
static struct udev_device *handle_scsi(struct udev_device *parent, char **path)
const char *id;
devtype = udev_device_get_devtype(parent);
const char *id;
devtype = udev_device_get_devtype(parent);
- if (devtype == NULL ||
strcmp(devtype, "scsi_device") != 0
)
+ if (devtype == NULL ||
!streq(devtype, "scsi_device")
)
return parent;
/* firewire */
return parent;
/* firewire */
@@
-438,7
+438,7
@@
static struct udev_device *handle_usb(struct udev_device *parent, char **path)
devtype = udev_device_get_devtype(parent);
if (devtype == NULL)
return parent;
devtype = udev_device_get_devtype(parent);
if (devtype == NULL)
return parent;
- if (
strcmp(devtype, "usb_interface") != 0 && strcmp(devtype, "usb_device") != 0
)
+ if (
!streq(devtype, "usb_interface") && !streq(devtype, "usb_device")
)
return parent;
str = udev_device_get_sysname(parent);
return parent;
str = udev_device_get_sysname(parent);
@@
-498,37
+498,37
@@
static int builtin_path_id(struct udev_device *dev, int argc, char *argv[], bool
subsys = udev_device_get_subsystem(parent);
if (subsys == NULL) {
;
subsys = udev_device_get_subsystem(parent);
if (subsys == NULL) {
;
- } else if (str
cmp(subsys, "scsi_tape") == 0
) {
+ } else if (str
eq(subsys, "scsi_tape")
) {
handle_scsi_tape(parent, &path);
handle_scsi_tape(parent, &path);
- } else if (str
cmp(subsys, "scsi") == 0
) {
+ } else if (str
eq(subsys, "scsi")
) {
parent = handle_scsi(parent, &path);
some_transport = true;
parent = handle_scsi(parent, &path);
some_transport = true;
- } else if (str
cmp(subsys, "cciss") == 0
) {
+ } else if (str
eq(subsys, "cciss")
) {
parent = handle_cciss(parent, &path);
some_transport = true;
parent = handle_cciss(parent, &path);
some_transport = true;
- } else if (str
cmp(subsys, "usb") == 0
) {
+ } else if (str
eq(subsys, "usb")
) {
parent = handle_usb(parent, &path);
some_transport = true;
parent = handle_usb(parent, &path);
some_transport = true;
- } else if (str
cmp(subsys, "serio") == 0
) {
+ } else if (str
eq(subsys, "serio")
) {
path_prepend(&path, "serio-%s", udev_device_get_sysnum(parent));
parent = skip_subsystem(parent, "serio");
path_prepend(&path, "serio-%s", udev_device_get_sysnum(parent));
parent = skip_subsystem(parent, "serio");
- } else if (str
cmp(subsys, "pci") == 0
) {
+ } else if (str
eq(subsys, "pci")
) {
path_prepend(&path, "pci-%s", udev_device_get_sysname(parent));
parent = skip_subsystem(parent, "pci");
path_prepend(&path, "pci-%s", udev_device_get_sysname(parent));
parent = skip_subsystem(parent, "pci");
- } else if (str
cmp(subsys, "platform") == 0
) {
+ } else if (str
eq(subsys, "platform")
) {
path_prepend(&path, "platform-%s", udev_device_get_sysname(parent));
parent = skip_subsystem(parent, "platform");
some_transport = true;
path_prepend(&path, "platform-%s", udev_device_get_sysname(parent));
parent = skip_subsystem(parent, "platform");
some_transport = true;
- } else if (str
cmp(subsys, "acpi") == 0
) {
+ } else if (str
eq(subsys, "acpi")
) {
path_prepend(&path, "acpi-%s", udev_device_get_sysname(parent));
parent = skip_subsystem(parent, "acpi");
path_prepend(&path, "acpi-%s", udev_device_get_sysname(parent));
parent = skip_subsystem(parent, "acpi");
- } else if (str
cmp(subsys, "xen") == 0
) {
+ } else if (str
eq(subsys, "xen")
) {
path_prepend(&path, "xen-%s", udev_device_get_sysname(parent));
parent = skip_subsystem(parent, "xen");
path_prepend(&path, "xen-%s", udev_device_get_sysname(parent));
parent = skip_subsystem(parent, "xen");
- } else if (str
cmp(subsys, "virtio") == 0
) {
+ } else if (str
eq(subsys, "virtio")
) {
path_prepend(&path, "virtio-pci-%s", udev_device_get_sysname(parent));
parent = skip_subsystem(parent, "virtio");
path_prepend(&path, "virtio-pci-%s", udev_device_get_sysname(parent));
parent = skip_subsystem(parent, "virtio");
- } else if (str
cmp(subsys, "scm") == 0
) {
+ } else if (str
eq(subsys, "scm")
) {
path_prepend(&path, "scm-%s", udev_device_get_sysname(parent));
parent = skip_subsystem(parent, "scm");
}
path_prepend(&path, "scm-%s", udev_device_get_sysname(parent));
parent = skip_subsystem(parent, "scm");
}
diff --git
a/src/udev/udev-builtin-usb_id.c
b/src/udev/udev-builtin-usb_id.c
index 7ce401d15253ac6c3081c18069ad6386b4bec458..01e42ca7b1a96d7fc9f7357830068b916300a467 100644
(file)
--- a/
src/udev/udev-builtin-usb_id.c
+++ b/
src/udev/udev-builtin-usb_id.c
@@
-273,7
+273,7
@@
static int builtin_usb_id(struct udev_device *dev, int argc, char *argv[], bool
instance_str[0] = '\0';
/* shortcut, if we are called directly for a "usb_device" type */
instance_str[0] = '\0';
/* shortcut, if we are called directly for a "usb_device" type */
- if (udev_device_get_devtype(dev) != NULL && str
cmp(udev_device_get_devtype(dev), "usb_device") == 0
) {
+ if (udev_device_get_devtype(dev) != NULL && str
eq(udev_device_get_devtype(dev), "usb_device")
) {
dev_if_packed_info(dev, packed_if_str, sizeof(packed_if_str));
dev_usb = dev;
goto fallback;
dev_if_packed_info(dev, packed_if_str, sizeof(packed_if_str));
dev_usb = dev;
goto fallback;
diff --git
a/src/udev/udev-builtin.c
b/src/udev/udev-builtin.c
index 0651ae2ff078528bf4d04069457107c5756ce174..57d75a13e45bf082b5e3b49d60685a6cf8c40512 100644
(file)
--- a/
src/udev/udev-builtin.c
+++ b/
src/udev/udev-builtin.c
@@
-115,7
+115,7
@@
enum udev_builtin_cmd udev_builtin_lookup(const char *command)
if (pos)
pos[0] = '\0';
for (i = 0; i < ELEMENTSOF(builtins); i++)
if (pos)
pos[0] = '\0';
for (i = 0; i < ELEMENTSOF(builtins); i++)
- if (str
cmp(builtins[i]->name, name) == 0
)
+ if (str
eq(builtins[i]->name, name)
)
return i;
return UDEV_BUILTIN_MAX;
}
return i;
return UDEV_BUILTIN_MAX;
}
diff --git
a/src/udev/udev-event.c
b/src/udev/udev-event.c
index ef9fc61c641fea622daced336540ff70e185a72a..efd9b6d71d84fdaff64887f5d8f975bd71ef5008 100644
(file)
--- a/
src/udev/udev-event.c
+++ b/
src/udev/udev-event.c
@@
-784,7
+784,7
@@
int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules,
if (udev_device_get_subsystem(dev) == NULL)
return -1;
if (udev_device_get_subsystem(dev) == NULL)
return -1;
- if (str
cmp(udev_device_get_action(dev), "remove") == 0
) {
+ if (str
eq(udev_device_get_action(dev), "remove")
) {
udev_device_read_db(dev, NULL);
udev_device_delete_db(dev);
udev_device_tag_index(dev, NULL, false);
udev_device_read_db(dev, NULL);
udev_device_delete_db(dev);
udev_device_tag_index(dev, NULL, false);
@@
-812,8
+812,8
@@
int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules,
udev_rules_apply_to_event(rules, event, sigmask);
/* rename a new network interface, if needed */
udev_rules_apply_to_event(rules, event, sigmask);
/* rename a new network interface, if needed */
- if (udev_device_get_ifindex(dev) > 0 && str
cmp(udev_device_get_action(dev), "add") == 0
&&
- event->name != NULL &&
strcmp(event->name, udev_device_get_sysname(dev)) != 0
) {
+ if (udev_device_get_ifindex(dev) > 0 && str
eq(udev_device_get_action(dev), "add")
&&
+ event->name != NULL &&
!streq(event->name, udev_device_get_sysname(dev))
) {
char syspath[UTIL_PATH_SIZE];
char *pos;
char syspath[UTIL_PATH_SIZE];
char *pos;
diff --git
a/src/udev/udev-node.c
b/src/udev/udev-node.c
index 363cee1d1c1dec15268835272004e09996725b6f..1148a1529cd7ada01f28245c631e5ec616bdf8f9 100644
(file)
--- a/
src/udev/udev-node.c
+++ b/
src/udev/udev-node.c
@@
-74,7
+74,7
@@
static int node_symlink(struct udev_device *dev, const char *node, const char *s
len = readlink(slink, buf, sizeof(buf));
if (len > 0 && len < (int)sizeof(buf)) {
buf[len] = '\0';
len = readlink(slink, buf, sizeof(buf));
if (len > 0 && len < (int)sizeof(buf)) {
buf[len] = '\0';
- if (str
cmp(target, buf) == 0
) {
+ if (str
eq(target, buf)
) {
log_debug("preserve already existing symlink '%s' to '%s'\n", slink, target);
label_fix(slink, true, false);
utimensat(AT_FDCWD, slink, NULL, AT_SYMLINK_NOFOLLOW);
log_debug("preserve already existing symlink '%s' to '%s'\n", slink, target);
label_fix(slink, true, false);
utimensat(AT_FDCWD, slink, NULL, AT_SYMLINK_NOFOLLOW);
@@
-154,7
+154,7
@@
static const char *link_find_prioritized(struct udev_device *dev, bool add, cons
log_debug("found '%s' claiming '%s'\n", dent->d_name, stackdir);
/* did we find ourself? */
log_debug("found '%s' claiming '%s'\n", dent->d_name, stackdir);
/* did we find ourself? */
- if (str
cmp(dent->d_name, udev_device_get_id_filename(dev)) == 0
)
+ if (str
eq(dent->d_name, udev_device_get_id_filename(dev))
)
continue;
dev_db = udev_device_new_from_device_id(udev, dent->d_name);
continue;
dev_db = udev_device_new_from_device_id(udev, dent->d_name);
@@
-238,7
+238,7
@@
void udev_node_update_old_links(struct udev_device *dev, struct udev_device *dev
udev_list_entry_foreach(list_entry_current, udev_device_get_devlinks_list_entry(dev)) {
const char *name_current = udev_list_entry_get_name(list_entry_current);
udev_list_entry_foreach(list_entry_current, udev_device_get_devlinks_list_entry(dev)) {
const char *name_current = udev_list_entry_get_name(list_entry_current);
- if (str
cmp(name, name_current) == 0
) {
+ if (str
eq(name, name_current)
) {
found = 1;
break;
}
found = 1;
break;
}
@@
-259,7
+259,7
@@
static int node_permissions_apply(struct udev_device *dev, bool apply, mode_t mo
struct stat stats;
int err = 0;
struct stat stats;
int err = 0;
- if (str
cmp(udev_device_get_subsystem(dev), "block") == 0
)
+ if (str
eq(udev_device_get_subsystem(dev), "block")
)
mode |= S_IFBLK;
else
mode |= S_IFCHR;
mode |= S_IFBLK;
else
mode |= S_IFCHR;
@@
-307,7
+307,7
@@
void udev_node_add(struct udev_device *dev, bool apply, mode_t mode, uid_t uid,
/* always add /dev/{block,char}/$major:$minor */
snprintf(filename, sizeof(filename), "/dev/%s/%u:%u",
/* always add /dev/{block,char}/$major:$minor */
snprintf(filename, sizeof(filename), "/dev/%s/%u:%u",
- str
cmp(udev_device_get_subsystem(dev), "block") == 0
? "block" : "char",
+ str
eq(udev_device_get_subsystem(dev), "block")
? "block" : "char",
major(udev_device_get_devnum(dev)), minor(udev_device_get_devnum(dev)));
node_symlink(dev, udev_device_get_devnode(dev), filename);
major(udev_device_get_devnum(dev)), minor(udev_device_get_devnum(dev)));
node_symlink(dev, udev_device_get_devnode(dev), filename);
@@
-327,7
+327,7
@@
void udev_node_remove(struct udev_device *dev)
/* remove /dev/{block,char}/$major:$minor */
snprintf(filename, sizeof(filename), "/dev/%s/%u:%u",
/* remove /dev/{block,char}/$major:$minor */
snprintf(filename, sizeof(filename), "/dev/%s/%u:%u",
- str
cmp(udev_device_get_subsystem(dev), "block") == 0
? "block" : "char",
+ str
eq(udev_device_get_subsystem(dev), "block")
? "block" : "char",
major(udev_device_get_devnum(dev)), minor(udev_device_get_devnum(dev)));
unlink(filename);
}
major(udev_device_get_devnum(dev)), minor(udev_device_get_devnum(dev)));
unlink(filename);
}
diff --git
a/src/udev/udevadm-info.c
b/src/udev/udevadm-info.c
index d6f82869b17a52db4c212e936a2f1033d3f9930b..0f4565eda8abaadb9f49355502106a9ad7cdb4e2 100644
(file)
--- a/
src/udev/udevadm-info.c
+++ b/
src/udev/udevadm-info.c
@@
-45,7
+45,7
@@
static bool skip_attribute(const char *name)
unsigned int i;
for (i = 0; i < ELEMENTSOF(skip); i++)
unsigned int i;
for (i = 0; i < ELEMENTSOF(skip); i++)
- if (str
cmp(name, skip[i]) == 0
)
+ if (str
eq(name, skip[i])
)
return true;
return false;
}
return true;
return false;
}
@@
-393,15
+393,15
@@
static int uinfo(struct udev *udev, int argc, char *argv[])
break;
case 'q':
action = ACTION_QUERY;
break;
case 'q':
action = ACTION_QUERY;
- if (str
cmp(optarg, "property") == 0 || strcmp(optarg, "env") == 0
) {
+ if (str
eq(optarg, "property") || streq(optarg, "env")
) {
query = QUERY_PROPERTY;
query = QUERY_PROPERTY;
- } else if (str
cmp(optarg, "name") == 0
) {
+ } else if (str
eq(optarg, "name")
) {
query = QUERY_NAME;
query = QUERY_NAME;
- } else if (str
cmp(optarg, "symlink") == 0
) {
+ } else if (str
eq(optarg, "symlink")
) {
query = QUERY_SYMLINK;
query = QUERY_SYMLINK;
- } else if (str
cmp(optarg, "path") == 0
) {
+ } else if (str
eq(optarg, "path")
) {
query = QUERY_PATH;
query = QUERY_PATH;
- } else if (str
cmp(optarg, "all") == 0
) {
+ } else if (str
eq(optarg, "all")
) {
query = QUERY_ALL;
} else {
fprintf(stderr, "unknown query type\n");
query = QUERY_ALL;
} else {
fprintf(stderr, "unknown query type\n");
diff --git
a/src/udev/udevadm-test.c
b/src/udev/udevadm-test.c
index f22a2c32cc7c4c0447d218ea32a5163ba49ff649..df1409bff64cdcb2c8a2f40e19b2036aecdb7b1e 100644
(file)
--- a/
src/udev/udevadm-test.c
+++ b/
src/udev/udevadm-test.c
@@
-66,11
+66,11
@@
static int adm_test(struct udev *udev, int argc, char *argv[])
action = optarg;
break;
case 'N':
action = optarg;
break;
case 'N':
- if (str
cmp (optarg, "early") == 0
) {
+ if (str
eq (optarg, "early")
) {
resolve_names = 1;
resolve_names = 1;
- } else if (str
cmp (optarg, "late") == 0
) {
+ } else if (str
eq (optarg, "late")
) {
resolve_names = 0;
resolve_names = 0;
- } else if (str
cmp (optarg, "never") == 0
) {
+ } else if (str
eq (optarg, "never")
) {
resolve_names = -1;
} else {
fprintf(stderr, "resolve-names must be early, late or never\n");
resolve_names = -1;
} else {
fprintf(stderr, "resolve-names must be early, late or never\n");
diff --git
a/src/udev/udevadm-trigger.c
b/src/udev/udevadm-trigger.c
index 4d96a786c3950b92517b12b8724274928dc06535..9624c66fba9e1a4b3f17cbc6ae50761ac94d6b5f 100644
(file)
--- a/
src/udev/udevadm-trigger.c
+++ b/
src/udev/udevadm-trigger.c
@@
-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);
diff --git
a/src/udev/udevadm.c
b/src/udev/udevadm.c
index 53419ffa62e481cac1e530dd552d0412875c2aab..e14b3ca27c0248f9c063a38f13e65f1e872a7846 100644
(file)
--- a/
src/udev/udevadm.c
+++ b/
src/udev/udevadm.c
@@
-131,7
+131,7
@@
int main(int argc, char *argv[])
if (command != NULL)
for (i = 0; i < ELEMENTSOF(udevadm_cmds); i++) {
if (command != NULL)
for (i = 0; i < ELEMENTSOF(udevadm_cmds); i++) {
- if (str
cmp(udevadm_cmds[i]->name, command) == 0
) {
+ if (str
eq(udevadm_cmds[i]->name, command)
) {
argc -= optind;
argv += optind;
/* we need '0' here to reset the internal state */
argc -= optind;
argv += optind;
/* we need '0' here to reset the internal state */
diff --git
a/src/udev/udevd.c
b/src/udev/udevd.c
index 9f184621ae45ff683996a2912bbbdbdd082f5d82..088a89f47084438f3ed2b771bdd880f114c411a1 100644
(file)
--- a/
src/udev/udevd.c
+++ b/
src/udev/udevd.c
@@
-499,7
+499,7
@@
static bool is_devpath_busy(struct event *event)
return true;
/* check our old name */
return true;
/* check our old name */
- if (event->devpath_old != NULL && str
cmp(loop_event->devpath, event->devpath_old) == 0
) {
+ if (event->devpath_old != NULL && str
eq(loop_event->devpath, event->devpath_old)
) {
event->delaying_seqnum = loop_event->seqnum;
return true;
}
event->delaying_seqnum = loop_event->seqnum;
return true;
}
@@
-1117,11
+1117,11
@@
int main(int argc, char *argv[])
udev_set_log_priority(udev, LOG_DEBUG);
break;
case 'N':
udev_set_log_priority(udev, LOG_DEBUG);
break;
case 'N':
- if (str
cmp (optarg, "early") == 0
) {
+ if (str
eq(optarg, "early")
) {
resolve_names = 1;
resolve_names = 1;
- } else if (str
cmp (optarg, "late") == 0
) {
+ } else if (str
eq(optarg, "late")
) {
resolve_names = 0;
resolve_names = 0;
- } else if (str
cmp (optarg, "never") == 0
) {
+ } else if (str
eq(optarg, "never")
) {
resolve_names = -1;
} else {
fprintf(stderr, "resolve-names must be early, late or never\n");
resolve_names = -1;
} else {
fprintf(stderr, "resolve-names must be early, late or never\n");