Fix "Failed to add path to set" error during nixos-rebuild

This commit is contained in:
Eelco Dolstra 2012-10-05 16:58:36 -04:00
parent 29aa7abe87
commit a4cd5afd03
2 changed files with 21 additions and 1 deletions

View File

@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
sha256 = "0cgnnl6kqaz3als5y9g8jvsvbs4c8ccp0vl4s1g8rwk69w2cwxd2";
};
patches = [ ./reexec.patch ];
patches = [ ./reexec.patch ./ignore-duplicates.patch ];
buildInputs =
[ pkgconfig intltool gperf libcap dbus kmod xz pam acl

View File

@ -0,0 +1,20 @@
Ignore duplicate paths in "systemctl start".
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index a4290c4..d3ac3ad 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -1596,8 +1596,11 @@ static int start_unit_one(
r = set_put(s, p);
if (r < 0) {
- log_error("Failed to add path to set.");
- return r;
+ free(p);
+ if (r != -EEXIST) {
+ log_error("Failed to add path %s to set.", p);
+ return r;
+ }
}
p = NULL;