Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/libcrun/cgroup-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,9 @@ rmdir_all_fd (int dfd)
dir = fdopendir (dfd);
if (dir == NULL)
{
int saved_errno = errno;
TEMP_FAILURE_RETRY (close (dfd));
errno = saved_errno;
return -1;
}

Expand Down
4 changes: 2 additions & 2 deletions src/libcrun/container.c
Original file line number Diff line number Diff line change
Expand Up @@ -3968,7 +3968,7 @@ libcrun_container_exec_with_options (libcrun_context_t *context, const char *id,
process = make_runtime_spec_schema_config_schema_process (tree, &ctx, &parser_err);
if (UNLIKELY (process == NULL))
{
ret = crun_make_error (err, errno, "cannot parse process file: `%s`", parser_err);
ret = crun_make_error (err, 0, "cannot parse process file: `%s`", parser_err);
free (parser_err);
if (tree)
yajl_tree_free (tree);
Expand Down Expand Up @@ -4177,7 +4177,7 @@ libcrun_container_update (libcrun_context_t *context, const char *id, const char
resources = make_runtime_spec_schema_config_linux_resources (tree, &ctx, &parser_err);
if (UNLIKELY (resources == NULL))
{
ret = crun_make_error (err, errno, "cannot parse resources: %s", parser_err);
ret = crun_make_error (err, 0, "cannot parse resources: %s", parser_err);
goto cleanup;
}

Expand Down
2 changes: 1 addition & 1 deletion src/libcrun/criu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1217,7 +1217,7 @@ libcrun_container_restore_linux_criu (libcrun_container_status_t *status, libcru
}
out:
ret_out = rmdir (root);
if (UNLIKELY (ret == -1))
if (UNLIKELY (ret < 0))
return ret;
if (UNLIKELY (ret_out == -1))
return crun_make_error (err, errno, "error removing restore directory `%s`", root);
Expand Down
4 changes: 2 additions & 2 deletions src/libcrun/linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -3969,7 +3969,7 @@ expect_success_from_sync_socket (int sync_fd, libcrun_error_t *err)

ret = TEMP_FAILURE_RETRY (read (sync_fd, &res, sizeof (res)));
if (UNLIKELY (ret != sizeof (res)))
return crun_make_error (err, errno, "read status from sync socket");
return crun_make_error (err, ret < 0 ? errno : 0, "read status from sync socket");

if (res == 0)
return 0;
Expand Down Expand Up @@ -5171,7 +5171,7 @@ libcrun_run_linux_container (libcrun_container_t *container, container_entrypoin

ret = TEMP_FAILURE_RETRY (read (sync_socket_host, &new_pid, sizeof (new_pid)));
if (UNLIKELY (ret != sizeof (new_pid)))
return crun_make_error (err, errno, "read pid from sync socket");
return crun_make_error (err, ret < 0 ? errno : 0, "read pid from sync socket");

/* Cleanup the first process. */
ret = waitpid_ignore_stopped (pid, NULL, 0);
Expand Down