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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user