2
0
mirror of git://github.com/lxc/lxc synced 2025-08-31 01:09:35 +00:00

conf: log failure to create tty mountpoint

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
Christian Brauner
2021-08-03 09:22:46 +02:00
parent 2d7001d9d8
commit 88c348f376

View File

@@ -946,11 +946,20 @@ static int open_ttymnt_at(int dfd, const char *path)
{
int fd;
fd = open_at(dfd, path, PROTECT_OPEN | O_CREAT | O_EXCL,
PROTECT_LOOKUP_BENEATH, 0);
if (fd < 0 && (errno == ENXIO || errno == EEXIST))
fd = open_at(dfd, path, PROTECT_OPATH_FILE,
PROTECT_LOOKUP_BENEATH, 0);
fd = open_at(dfd, path,
PROTECT_OPEN | O_CREAT | O_EXCL,
PROTECT_LOOKUP_BENEATH,
0);
if (fd < 0) {
if (!IN_SET(errno, ENXIO, EEXIST))
return syserror("Failed to create \"%d/\%s\"", dfd, path);
SYSINFO("Failed to create \"%d/\%s\"", dfd, path);
fd = open_at(dfd, path,
PROTECT_OPATH_FILE,
PROTECT_LOOKUP_BENEATH,
0);
}
return fd;
}