summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-09-01 23:03:22 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-09-23 17:18:50 +0900
commit403660c508153a65ac3738b1f0884c74feb4acf6 (patch)
treeaebc3321591d28bd3347821650adc48136940ff7
parentdcfbde3a43d632ff6e286c77e1081087eca59d8e (diff)
downloadsystemd-403660c508153a65ac3738b1f0884c74feb4acf6.tar.gz
tree-wide: use streq() instead of streq_ptr()
-rw-r--r--src/backlight/backlight.c4
-rw-r--r--src/login/logind-core.c12
-rw-r--r--src/login/logind-session-device.c4
-rw-r--r--src/login/logind.c2
-rw-r--r--src/rfkill/rfkill.c2
5 files changed, 12 insertions, 12 deletions
diff --git a/src/backlight/backlight.c b/src/backlight/backlight.c
index 5579d8a8bf..fb8e3742e8 100644
--- a/src/backlight/backlight.c
+++ b/src/backlight/backlight.c
@@ -88,7 +88,7 @@ static int same_device(sd_device *a, sd_device *b) {
if (r < 0)
return r;
- if (!streq_ptr(a_val, b_val))
+ if (!streq(a_val, b_val))
return false;
r = sd_device_get_sysname(a, &a_val);
@@ -99,7 +99,7 @@ static int same_device(sd_device *a, sd_device *b) {
if (r < 0)
return r;
- return streq_ptr(a_val, b_val);
+ return streq(a_val, b_val);
}
static int validate_device(sd_device *device) {
diff --git a/src/login/logind-core.c b/src/login/logind-core.c
index dac240d294..d2351b9340 100644
--- a/src/login/logind-core.c
+++ b/src/login/logind-core.c
@@ -218,14 +218,14 @@ int manager_add_button(Manager *m, const char *name, Button **_button) {
}
int manager_process_seat_device(Manager *m, sd_device *d) {
- const char *action = NULL;
+ const char *action;
Device *device;
int r;
assert(m);
- (void) sd_device_get_property_value(d, "ACTION", &action);
- if (streq_ptr(action, "remove")) {
+ if (sd_device_get_property_value(d, "ACTION", &action) >= 0 &&
+ streq(action, "remove")) {
const char *syspath;
r = sd_device_get_syspath(d, &syspath);
@@ -285,7 +285,7 @@ int manager_process_seat_device(Manager *m, sd_device *d) {
}
int manager_process_button_device(Manager *m, sd_device *d) {
- const char *action = NULL, *sysname;
+ const char *action, *sysname;
Button *b;
int r;
@@ -295,8 +295,8 @@ int manager_process_button_device(Manager *m, sd_device *d) {
if (r < 0)
return r;
- (void) sd_device_get_property_value(d, "ACTION", &action);
- if (streq_ptr(action, "remove")) {
+ if (sd_device_get_property_value(d, "ACTION", &action) >= 0 &&
+ streq(action, "remove")) {
b = hashmap_get(m->buttons, sysname);
if (!b)
diff --git a/src/login/logind-session-device.c b/src/login/logind-session-device.c
index fbba792ed6..0b798cf0a2 100644
--- a/src/login/logind-session-device.c
+++ b/src/login/logind-session-device.c
@@ -255,10 +255,10 @@ static DeviceType detect_device_type(sd_device *dev) {
sd_device_get_subsystem(dev, &subsystem) < 0)
return type;
- if (streq_ptr(subsystem, "drm")) {
+ if (streq(subsystem, "drm")) {
if (startswith(sysname, "card"))
type = DEVICE_TYPE_DRM;
- } else if (streq_ptr(subsystem, "input")) {
+ } else if (streq(subsystem, "input")) {
if (startswith(sysname, "event"))
type = DEVICE_TYPE_EVDEV;
}
diff --git a/src/login/logind.c b/src/login/logind.c
index b9ad1007ae..e90c8575dc 100644
--- a/src/login/logind.c
+++ b/src/login/logind.c
@@ -580,7 +580,7 @@ static int manager_dispatch_vcsa_udev(sd_event_source *s, int fd, uint32_t reven
if (sd_device_get_sysname(d, &name) >= 0 &&
startswith(name, "vcsa") &&
sd_device_get_property_value(d, "ACTION", &action) >= 0 &&
- streq_ptr(action, "remove"))
+ streq(action, "remove"))
seat_preallocate_vts(m->seat0);
return 0;
diff --git a/src/rfkill/rfkill.c b/src/rfkill/rfkill.c
index 36b82a4c92..7939c2d2fe 100644
--- a/src/rfkill/rfkill.c
+++ b/src/rfkill/rfkill.c
@@ -149,7 +149,7 @@ static int wait_for_initialized(
if (r < 0)
continue;
- if (sd_device_get_sysname(t, &name) >= 0 && streq_ptr(name, sysname)) {
+ if (sd_device_get_sysname(t, &name) >= 0 && streq(name, sysname)) {
*ret = TAKE_PTR(t);
return 0;
}