summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2017-12-15 16:36:35 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2017-12-19 10:43:57 +0900
commit586290017d09a1081bfcd328098022a933d40888 (patch)
tree2b82583181bd2f5939709e80b6831c721397a1a2 /src
parentbf0e0a4df2d41a5631811f7db6b6c1c866c3ed80 (diff)
downloadsystemd-586290017d09a1081bfcd328098022a933d40888.tar.gz
systemd-586290017d09a1081bfcd328098022a933d40888.tar.bz2
systemd-586290017d09a1081bfcd328098022a933d40888.zip
tree-wide: use !strv_isempty() instead of strv_length() > 0
Diffstat (limited to 'src')
-rw-r--r--src/core/execute.c6
-rw-r--r--src/notify/notify.c2
-rw-r--r--src/shared/ask-password-api.c2
-rw-r--r--src/shared/bus-unit-util.c2
4 files changed, 6 insertions, 6 deletions
diff --git a/src/core/execute.c b/src/core/execute.c
index b91f654994..aa9120b2ed 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -4162,19 +4162,19 @@ void exec_context_dump(ExecContext *c, FILE* f, const char *prefix) {
if (c->pam_name)
fprintf(f, "%sPAMName: %s\n", prefix, c->pam_name);
- if (strv_length(c->read_write_paths) > 0) {
+ if (!strv_isempty(c->read_write_paths)) {
fprintf(f, "%sReadWritePaths:", prefix);
strv_fprintf(f, c->read_write_paths);
fputs("\n", f);
}
- if (strv_length(c->read_only_paths) > 0) {
+ if (!strv_isempty(c->read_only_paths)) {
fprintf(f, "%sReadOnlyPaths:", prefix);
strv_fprintf(f, c->read_only_paths);
fputs("\n", f);
}
- if (strv_length(c->inaccessible_paths) > 0) {
+ if (!strv_isempty(c->inaccessible_paths)) {
fprintf(f, "%sInaccessiblePaths:", prefix);
strv_fprintf(f, c->inaccessible_paths);
fputs("\n", f);
diff --git a/src/notify/notify.c b/src/notify/notify.c
index 3e511b7e47..4a34e1e9db 100644
--- a/src/notify/notify.c
+++ b/src/notify/notify.c
@@ -179,7 +179,7 @@ int main(int argc, char* argv[]) {
goto finish;
}
- if (strv_length(final_env) <= 0) {
+ if (strv_isempty(final_env)) {
r = 0;
goto finish;
}
diff --git a/src/shared/ask-password-api.c b/src/shared/ask-password-api.c
index 17928a9732..346d8c9d24 100644
--- a/src/shared/ask-password-api.c
+++ b/src/shared/ask-password-api.c
@@ -656,7 +656,7 @@ int ask_password_agent(
goto finish;
}
- if (strv_length(l) <= 0) {
+ if (strv_isempty(l)) {
l = strv_free(l);
log_debug("Invalid packet");
continue;
diff --git a/src/shared/bus-unit-util.c b/src/shared/bus-unit-util.c
index 8af738d8ce..372e431d63 100644
--- a/src/shared/bus-unit-util.c
+++ b/src/shared/bus-unit-util.c
@@ -1269,7 +1269,7 @@ int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignmen
if (r < 0)
return r;
- if (strv_length(l) > 0) {
+ if (!strv_isempty(l)) {
r = sd_bus_message_open_container(m, 'r', "sasb");
if (r < 0)