Skip to content

Commit

Permalink
linux: ignore errors creating /dev/console
Browse files Browse the repository at this point in the history
ignore errors if the file cannot be created as it might already
exist.  We are anyway going to create a mount on top of it and we'll
catch possible errors during the mount itself.

Closes: containers#150

Signed-off-by: Giuseppe Scrivano <[email protected]>
  • Loading branch information
giuseppe committed Oct 29, 2019
1 parent d73f362 commit af00deb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/libcrun/linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -1863,7 +1863,10 @@ libcrun_set_terminal (libcrun_container_t *container, libcrun_error_t *err)

ret = write_file ("/dev/console", NULL, 0, err);
if (UNLIKELY (ret < 0))
return ret;
{
/* Ignore errors if the file creation fails. */
crun_error_release (err);
}

ret = do_mount (container, slave, "/dev/console", "devpts", MS_BIND, NULL, 0, err);
if (UNLIKELY (ret < 0))
Expand Down

0 comments on commit af00deb

Please sign in to comment.