]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/machine/machined-dbus.c
machine-image: rework error handling
authorLennart Poettering <lennart@poettering.net>
Fri, 6 Apr 2018 16:53:57 +0000 (18:53 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 24 May 2018 15:01:57 +0000 (17:01 +0200)
commit3a6ce860ac3e3c549e92f5f3254d1934dc543c24
tree94e809ef8e5d6e72ff51a8101e3d45f207e84d95
parent225219e5040a43291d07b30f501c11f85a19695b
machine-image: rework error handling

Let's rework error handling a bit in image_find() and friends: when we
can't find an image, return -ENOENT rather than 0. That's better as
before we violated the usual rule in our codebase that return parameters
are initialized when the return value is >= 0 and otherwise not touched.

This also makes enumeration and validation a bit more strict: we'll only
accept ".raw" as suffix for regular files, and filter out this suffix
handling on directories/subvolumes, where it makes no sense.
src/import/export.c
src/import/import.c
src/import/pull.c
src/machine/image-dbus.c
src/machine/machined-dbus.c
src/nspawn/nspawn.c
src/shared/machine-image.c