]> git.proxmox.com Git - mirror_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)
committerPetr Malat <oss@malat.biz>
Tue, 20 Jul 2021 13:43:24 +0000 (15:43 +0200)
commit128655e7654cc95f658d905927a97cf065136782
tree7b8230310a13c8da6503d7e2d583fd0263565dc8
parent0a755306618f7f0aa450d439c34a86d8c8683682
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