[systemd-commits] 2 commits - src/99-systemd.rules.in src/strv.c
Lennart Poettering
lennart at kemper.freedesktop.org
Tue Aug 23 16:10:27 PDT 2011
src/99-systemd.rules.in | 2 +-
src/strv.c | 21 +++++++++++++--------
2 files changed, 14 insertions(+), 9 deletions(-)
New commits:
commit 700de55514bc3137bb90aa87326f2ed80e675dda
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Aug 24 01:10:13 2011 +0200
strv: fix counting in strv_env_delete()
diff --git a/src/strv.c b/src/strv.c
index a52440d..92851b2 100644
--- a/src/strv.c
+++ b/src/strv.c
@@ -482,8 +482,8 @@ static bool env_match(const char *t, const char *pattern) {
}
char **strv_env_delete(char **x, unsigned n_lists, ...) {
- size_t n = 0, i = 0;
- char **l, **k, **r, **j;
+ size_t n, i = 0;
+ char **k, **r;
va_list ap;
/* Deletes every entry from x that is mentioned in the other
@@ -491,29 +491,34 @@ char **strv_env_delete(char **x, unsigned n_lists, ...) {
n = strv_length(x);
- if (!(r = new(char*, n+1)))
+ r = new(char*, n+1);
+ if (!r)
return NULL;
STRV_FOREACH(k, x) {
+ unsigned v;
+
va_start(ap, n_lists);
+ for (v = 0; v < n_lists; v++) {
+ char **l, **j;
- for (i = 0; i < n_lists; i++) {
l = va_arg(ap, char**);
STRV_FOREACH(j, l)
if (env_match(*k, *j))
- goto delete;
+ goto skip;
}
-
va_end(ap);
- if (!(r[i++] = strdup(*k))) {
+ r[i] = strdup(*k);
+ if (!r[i]) {
strv_free(r);
return NULL;
}
+ i++;
continue;
- delete:
+ skip:
va_end(ap);
}
commit 944d6c04270932cbfb1baf3e24a127d31531904f
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Aug 24 01:09:21 2011 +0200
udev: since bt devices cannot be renamed revert to %k
diff --git a/src/99-systemd.rules.in b/src/99-systemd.rules.in
index c036e2d..a9e740e 100644
--- a/src/99-systemd.rules.in
+++ b/src/99-systemd.rules.in
@@ -31,7 +31,7 @@ SUBSYSTEM=="block", KERNEL!="ram*|loop*", ENV{DM_UUID}=="CRYPT-*", ENV{ID_PART_T
# http://git.kernel.org/?p=linux/hotplug/udev.git;a=blob;f=libudev/libudev-enumerate.c;h=da831449dcaf5e936a14409e8e68ab12d30a98e2;hb=HEAD#l742
SUBSYSTEM=="net", KERNEL!="lo", TAG+="systemd", ENV{SYSTEMD_ALIAS}="/sys/subsystem/net/devices/$name"
-SUBSYSTEM=="bluetooth", TAG+="systemd", ENV{SYSTEMD_ALIAS}="/sys/subsystem/bluetooth/devices/$name"
+SUBSYSTEM=="bluetooth", TAG+="systemd", ENV{SYSTEMD_ALIAS}="/sys/subsystem/bluetooth/devices/%k"
SUBSYSTEM=="bluetooth", TAG+="systemd", ENV{SYSTEMD_WANTS}="bluetooth.target"
ENV{ID_SMARTCARD_READER}=="*?", TAG+="systemd", ENV{SYSTEMD_WANTS}="smartcard.target"
More information about the systemd-commits
mailing list