Skip to content

Commit 2e5803b

Browse files
authored
Merge pull request #1972 from eriksjolund/improve-error-handling-after-copy
container: improve error handling after libcrun_copy_config_file call
2 parents 050c192 + a83a4cf commit 2e5803b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/libcrun/container.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3297,7 +3297,11 @@ libcrun_container_create (libcrun_context_t *context, libcrun_container_t *conta
32973297

32983298
ret = libcrun_copy_config_file (context->id, context->state_root, container, err);
32993299
if (UNLIKELY (ret < 0))
3300-
libcrun_fail_with_error (errno, "copy config file");
3300+
{
3301+
int errcode = crun_error_get_errno (err);
3302+
crun_error_release (err);
3303+
libcrun_fail_with_error (errcode, "copy config file");
3304+
}
33013305

33023306
ret = libcrun_container_run_internal (container, context, &pipefd1, err);
33033307
if (UNLIKELY (ret < 0))

0 commit comments

Comments
 (0)