summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Mack <github@zonque.org>2015-07-24 10:08:44 +0200
committerDaniel Mack <github@zonque.org>2015-07-24 10:08:44 +0200
commit4026f52a24ca3b09228db9e0277e25489cdc9205 (patch)
tree73fbed587f9be9d387300467de6f08a4487cef7f /src
parent43472ac4cc770e601d70fd0afb0ef3b19fc77390 (diff)
parentfc1ba5d1933d83c73cf9ddb61e8a2da2b15e26e1 (diff)
Merge pull request #697 from poettering/service-bus-name
core: print a nicer warning when two units have the same BusName= set…
Diffstat (limited to 'src')
-rw-r--r--src/core/service.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/service.c b/src/core/service.c
index 39a2507b6f..b790ec98be 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -401,7 +401,6 @@ static int service_add_fd_store_set(Service *s, FDSet *fds) {
r = service_add_fd_store(s, fd);
if (r < 0)
return log_unit_error_errno(UNIT(s), r, "Couldn't add fd to fd store: %m");
-
if (r > 0) {
log_unit_debug(UNIT(s), "Added fd to fd store.");
fd = -1;
@@ -576,8 +575,10 @@ static int service_add_extras(Service *s) {
return r;
r = unit_watch_bus_name(UNIT(s), s->bus_name);
+ if (r == -EEXIST)
+ return log_unit_error_errno(UNIT(s), r, "Two services allocated for the same bus name %s, refusing operation.", s->bus_name);
if (r < 0)
- return r;
+ return log_unit_error_errno(UNIT(s), r, "Cannot watch bus name %s: %m", s->bus_name);
}
if (UNIT(s)->default_dependencies) {