]> git.ipfire.org Git - thirdparty/lxc.git/commit
lxc_setup_ttys: Handle existing ttyN file without underlying device
authorPetr Malat <oss@malat.biz>
Mon, 19 Jul 2021 19:51:25 +0000 (21:51 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Thu, 22 Jul 2021 07:25:30 +0000 (09:25 +0200)
commit206128fc762fc07bdd064de837bff31d91aa77e7
treedc5e6fb405fe0a16454ad13094062d7f340e5aae
parent5189fc482099d88768fcfb1a0edac51dd0bfff36
lxc_setup_ttys: Handle existing ttyN file without underlying device

If a device file is opened and there isn't the underlying device,
the open call fails with ENXIO, but the path can be opened with
O_PATH, which is enough for mounting over the device file.

Generalize this idea and use O_PATH for all cases when the file
is there. One still must check for both ENXIO and EEXIST as it's
unspecified what error is reported if multiple error conditions
occur at the same time.

Signed-off-by: Petr Malat <oss@malat.biz>
src/lxc/conf.c