- r = busname_watch_fd(n);
- if (r < 0) {
- log_warning_unit(UNIT(n)->id, "%s failed to watch names: %s", UNIT(n)->id, strerror(-r));
- goto fail;
- }
+ if (n->activating) {
+ r = busname_watch_fd(n);
+ if (r < 0) {
+ log_warning_unit(UNIT(n)->id, "%s failed to watch names: %s", UNIT(n)->id, strerror(-r));
+ goto fail;
+ }
+
+ busname_set_state(n, BUSNAME_LISTENING);
+ } else
+ busname_set_state(n, BUSNAME_REGISTERED);