tree-wide: error handling modernizations

This commit is contained in:
Lennart Poettering
2023-03-01 22:52:55 +00:00
committed by Luca Boccassi
parent 8c7a6c742a
commit 1406bd66e4
2 changed files with 17 additions and 13 deletions
+2 -2
View File
@@ -5518,8 +5518,8 @@ static int run(int argc, char *argv[]) {
* two systems write to the same /var). Let's allow it for the special cases where /var is
* either copied (i.e. --ephemeral) or replaced (i.e. --volatile=yes|state). */
if (path_equal(arg_directory, "/") && !(arg_ephemeral || IN_SET(arg_volatile_mode, VOLATILE_YES, VOLATILE_STATE))) {
log_error("Spawning container on root directory is not supported. Consider using --ephemeral, --volatile=yes or --volatile=state.");
r = -EINVAL;
r = log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"Spawning container on root directory is not supported. Consider using --ephemeral, --volatile=yes or --volatile=state.");
goto finish;
}