]> git.ipfire.org Git - thirdparty/systemd.git/commit
homework: move allocation/destruction into outer/generic scope
authorLennart Poettering <lennart@poettering.net>
Mon, 18 Oct 2021 11:59:29 +0000 (13:59 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 18 Oct 2021 20:45:19 +0000 (22:45 +0200)
commita74e2e447fde027b74ca9768a0c27d3408b95dac
tree8f13745e8c2a520f7ee31224d9307709982bdcad
parent4e660eca4543a6e34399577958e4a6c113cbb04d
homework: move allocation/destruction into outer/generic scope

Previously in most cases we'd allocate the HomeSetup context object
in generic code in homework.c. But for some cases we allocated them
instead inside the specific code in homework-{cifs,directory,luks}.c
Let's clean that up, and systematically allocate it in the outer
"entrypoint" calls in homework.c instead of the inner ones.

This doesn't change much in behaviour (i.e. it just means when something
fails we'll now clean it up one stack frame further up). But it will
allow is to more easily work with the context objects, since we'll have
them around in all stack frames.
src/home/homework-cifs.c
src/home/homework-cifs.h
src/home/homework-directory.c
src/home/homework-directory.h
src/home/homework-luks.c
src/home/homework-luks.h
src/home/homework.c