]> git.ipfire.org Git - thirdparty/systemd.git/commit
core/manager: move environment serialization out to basic/env-util.c
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 11 Feb 2017 02:44:21 +0000 (21:44 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 20 Feb 2017 23:49:14 +0000 (18:49 -0500)
commitfe902fa496abb4583c5befaf671a2402b650cd14
treea328afdd51df65ebaaf1a219f8056ef41e1049d8
parent71cb7d306ab42712f274337c457ac5cbdeff363c
core/manager: move environment serialization out to basic/env-util.c

This protocol is generally useful, we might just as well reuse it for the
env. generators.

The implementation is changed a bit: instead of making a new strv and freeing
the old one, just mutate the original. This is much faster with larger arrays,
while in fact atomicity is preserved, since we only either insert the new
entry or not, without being in inconsistent state.

v2:
- fix confusion with return value
src/basic/env-util.c
src/basic/env-util.h
src/core/manager.c