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:
d49dc81
)
Transpose args in strv_fnmatch() to be more oo
author
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Mon, 16 Feb 2015 19:04:36 +0000
(14:04 -0500)
committer
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Mon, 16 Feb 2015 19:04:36 +0000
(14:04 -0500)
src/analyze/analyze.c
patch
|
blob
|
history
src/libsystemd-network/network-internal.c
patch
|
blob
|
history
src/shared/strv.c
patch
|
blob
|
history
src/shared/strv.h
patch
|
blob
|
history
src/systemctl/systemctl.c
patch
|
blob
|
history
diff --git
a/src/analyze/analyze.c
b/src/analyze/analyze.c
index 1e2a6bbf25b036d6a24d0cb4a503759af5cac7b4..591b4ab14e74a73a1681f9ce4ae681f0b9811cba 100644
(file)
--- a/
src/analyze/analyze.c
+++ b/
src/analyze/analyze.c
@@
-980,11
+980,11
@@
static int graph_one_property(sd_bus *bus, const UnitInfo *u, const char* prop,
assert(prop);
assert(color);
assert(prop);
assert(color);
- match_patterns = strv_fnmatch(
u->id, patterns
, 0);
+ match_patterns = strv_fnmatch(
patterns, u->id
, 0);
if (!strv_isempty(arg_dot_from_patterns) &&
!match_patterns &&
if (!strv_isempty(arg_dot_from_patterns) &&
!match_patterns &&
- !strv_fnmatch(
u->id, arg_dot_from_patterns
, 0))
+ !strv_fnmatch(
arg_dot_from_patterns, u->id
, 0))
return 0;
r = bus_get_unit_property_strv(bus, u->unit_path, prop, &units);
return 0;
r = bus_get_unit_property_strv(bus, u->unit_path, prop, &units);
@@
-994,11
+994,11
@@
static int graph_one_property(sd_bus *bus, const UnitInfo *u, const char* prop,
STRV_FOREACH(unit, units) {
bool match_patterns2;
STRV_FOREACH(unit, units) {
bool match_patterns2;
- match_patterns2 = strv_fnmatch(
*unit, patterns
, 0);
+ match_patterns2 = strv_fnmatch(
patterns, *unit
, 0);
if (!strv_isempty(arg_dot_to_patterns) &&
!match_patterns2 &&
if (!strv_isempty(arg_dot_to_patterns) &&
!match_patterns2 &&
- !strv_fnmatch(
*unit, arg_dot_to_patterns
, 0))
+ !strv_fnmatch(
arg_dot_to_patterns, *unit
, 0))
continue;
if (!strv_isempty(patterns) && !match_patterns && !match_patterns2)
continue;
if (!strv_isempty(patterns) && !match_patterns && !match_patterns2)
diff --git
a/src/libsystemd-network/network-internal.c
b/src/libsystemd-network/network-internal.c
index 81f90aa3893cd842d075256b6ef542f2db261aac..b8e4e21716f596fa43116560ca7ccb5588c4c89f 100644
(file)
--- a/
src/libsystemd-network/network-internal.c
+++ b/
src/libsystemd-network/network-internal.c
@@
-113,19
+113,19
@@
bool net_match_config(const struct ether_addr *match_mac,
return false;
if (!strv_isempty(match_paths) &&
return false;
if (!strv_isempty(match_paths) &&
- (!dev_path || !strv_fnmatch(
dev_path, match_paths
, 0)))
+ (!dev_path || !strv_fnmatch(
match_paths, dev_path
, 0)))
return false;
if (!strv_isempty(match_drivers) &&
return false;
if (!strv_isempty(match_drivers) &&
- (!dev_driver || !strv_fnmatch(
dev_driver, match_drivers
, 0)))
+ (!dev_driver || !strv_fnmatch(
match_drivers, dev_driver
, 0)))
return false;
if (!strv_isempty(match_types) &&
return false;
if (!strv_isempty(match_types) &&
- (!dev_type || !strv_fnmatch_or_empty(
dev_type, match_types
, 0)))
+ (!dev_type || !strv_fnmatch_or_empty(
match_types, dev_type
, 0)))
return false;
if (!strv_isempty(match_names) &&
return false;
if (!strv_isempty(match_names) &&
- (!dev_name || !strv_fnmatch_or_empty(
dev_name, match_names
, 0)))
+ (!dev_name || !strv_fnmatch_or_empty(
match_names, dev_name
, 0)))
return false;
return true;
return false;
return true;
diff --git
a/src/shared/strv.c
b/src/shared/strv.c
index 2268bf61db33ff42427b8731b60e82d2f3282ee0..e27ac68151dd01a5966ab48c90db34420fcd2510 100644
(file)
--- a/
src/shared/strv.c
+++ b/
src/shared/strv.c
@@
-693,7
+693,7
@@
char **strv_reverse(char **l) {
return l;
}
return l;
}
-bool strv_fnmatch(c
onst char *s, char* const* pattern
s, int flags) {
+bool strv_fnmatch(c
har* const* patterns, const char *
s, int flags) {
char* const* p;
STRV_FOREACH(p, patterns)
char* const* p;
STRV_FOREACH(p, patterns)
diff --git
a/src/shared/strv.h
b/src/shared/strv.h
index a899395ba4efb1ebc0c439a1b4474d75828b0e3d..518c4c2aa8b94da5d013a97127ef3d27595a8e43 100644
(file)
--- a/
src/shared/strv.h
+++ b/
src/shared/strv.h
@@
-146,10
+146,10
@@
void strv_print(char **l);
char **strv_reverse(char **l);
char **strv_reverse(char **l);
-bool strv_fnmatch(c
onst char *s, char* const* pattern
s, int flags);
+bool strv_fnmatch(c
har* const* patterns, const char *
s, int flags);
-static inline bool strv_fnmatch_or_empty(c
onst char *s, char* const* pattern
s, int flags) {
+static inline bool strv_fnmatch_or_empty(c
har* const* patterns, const char *
s, int flags) {
assert(s);
return strv_isempty(patterns) ||
assert(s);
return strv_isempty(patterns) ||
- strv_fnmatch(
s, pattern
s, flags);
+ strv_fnmatch(
patterns,
s, flags);
}
}
diff --git
a/src/systemctl/systemctl.c
b/src/systemctl/systemctl.c
index 66bfd0eab7a65ce22a1f7f908afb71543835f452..21cb898b9af66042085edbe4ce4160c8f27b8dd6 100644
(file)
--- a/
src/systemctl/systemctl.c
+++ b/
src/systemctl/systemctl.c
@@
-310,7
+310,7
@@
static int compare_unit_info(const void *a, const void *b) {
}
static bool output_show_unit(const UnitInfo *u, char **patterns) {
}
static bool output_show_unit(const UnitInfo *u, char **patterns) {
- if (!strv_fnmatch_or_empty(
u->id, patterns
, FNM_NOESCAPE))
+ if (!strv_fnmatch_or_empty(
patterns, u->id
, FNM_NOESCAPE))
return false;
if (arg_types) {
return false;
if (arg_types) {
@@
-1247,7
+1247,7
@@
static int compare_unit_file_list(const void *a, const void *b) {
}
static bool output_show_unit_file(const UnitFileList *u, char **patterns) {
}
static bool output_show_unit_file(const UnitFileList *u, char **patterns) {
- if (!strv_fnmatch_or_empty(
basename(u->path), patterns
, FNM_NOESCAPE))
+ if (!strv_fnmatch_or_empty(
patterns, basename(u->path)
, FNM_NOESCAPE))
return false;
if (!strv_isempty(arg_types)) {
return false;
if (!strv_isempty(arg_types)) {
@@
-1720,7
+1720,7
@@
static int get_machine_properties(sd_bus *bus, struct machine_info *mi) {
}
static bool output_show_machine(const char *name, char **patterns) {
}
static bool output_show_machine(const char *name, char **patterns) {
- return strv_fnmatch_or_empty(
name, patterns
, FNM_NOESCAPE);
+ return strv_fnmatch_or_empty(
patterns, name
, FNM_NOESCAPE);
}
static int get_machine_list(
}
static int get_machine_list(
@@
-2073,7
+2073,7
@@
static void output_jobs_list(const struct job_info* jobs, unsigned n, bool skipp
}
static bool output_show_job(struct job_info *job, char **patterns) {
}
static bool output_show_job(struct job_info *job, char **patterns) {
- return strv_fnmatch_or_empty(
job->name, patterns
, FNM_NOESCAPE);
+ return strv_fnmatch_or_empty(
patterns, job->name
, FNM_NOESCAPE);
}
static int list_jobs(sd_bus *bus, char **args) {
}
static int list_jobs(sd_bus *bus, char **args) {