core: don't load dropin data multiple times for the same unit (#5139)
authorFranck Bui <fbui@suse.com>
Tue, 24 Jan 2017 13:29:57 +0000 (14:29 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 24 Jan 2017 13:29:57 +0000 (08:29 -0500)
commit2d058a87ffb2d31a50422a8aebd119bbb4427244
treead8a1da2ac1fa315dc78385773365668702ae191
parenta341dfe563bf3be791107a0c98d47f74366c637d
core: don't load dropin data multiple times for the same unit (#5139)

When an alias is loaded, we resolve this alias to its final unit first to load
the dropin data.

However if the final unit was already loaded, there's no point in reloading the
dropin data a second time.

This patch optimizes this case.

Also this allows the dropin loading code to assume that only units not yet
loaded are passed down. This assumption is not yet used but might be in the
future.

[zj: invert the condition in the if]
src/core/unit.c