Skip to content

Commit 205101a

Browse files
committed
container: add missing crun_make_error
Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
1 parent 342775a commit 205101a

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/libcrun/container.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3367,7 +3367,7 @@ libcrun_container_start (libcrun_context_t *context, const char *id, libcrun_err
33673367

33683368
ret = select (fd + 1, &read_set, NULL, NULL, &timeout);
33693369
if (UNLIKELY (ret < 0))
3370-
return ret;
3370+
return crun_make_error (err, errno, "select failed");
33713371
if (ret)
33723372
{
33733373
ret = handle_notify_socket (fd, err);
@@ -4461,16 +4461,21 @@ libcrun_container_get_features (libcrun_context_t *context, struct features_info
44614461
int
44624462
libcrun_container_spec (bool root, FILE *out, libcrun_error_t *err)
44634463
{
4464+
int ret;
44644465
int cgroup_mode;
44654466

44664467
cgroup_mode = libcrun_get_cgroup_mode (err);
44674468
if (UNLIKELY (cgroup_mode < 0))
44684469
return cgroup_mode;
44694470

4470-
return fprintf (out, spec_file,
4471+
ret = fprintf (out, spec_file,
44714472
root ? spec_pts_tty_group : "\n",
44724473
root ? "" : spec_user,
44734474
cgroup_mode == CGROUP_MODE_UNIFIED ? spec_cgroupns : "");
4475+
if (UNLIKELY (ret < 0))
4476+
return crun_make_error (err, errno, "fprintf failed");
4477+
4478+
return 0;
44744479
}
44754480

44764481
int
@@ -4557,7 +4562,7 @@ restore_proxy_process (int *proxy_pid_pipe, int cgroup_manager, libcrun_error_t
45574562

45584563
ret = TEMP_FAILURE_RETRY (read (*proxy_pid_pipe, &new_pid, sizeof (new_pid)));
45594564
if (UNLIKELY (ret < 0))
4560-
return ret;
4565+
return crun_make_error (err, errno, "read failed");
45614566

45624567
close_and_reset (proxy_pid_pipe);
45634568

0 commit comments

Comments
 (0)