2
0
mirror of git://github.com/lxc/lxc synced 2025-08-29 14:49:55 +00:00

terminal: log at warning message

The lxc_devpts_terminal() helper is called in contexts where it can fail
due to various reasons but where we safely fallback to allocating
terminal devices on the host. Logging error messages irritates users so
just log warning messages.

Link: https://discuss.linuxcontainers.org/t/lxc-attach-error-failed-to-open-terminal-multiplexer-device
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
Christian Brauner 2021-10-11 15:21:45 +02:00
parent 15f29e6fb7
commit 0cf017f071
No known key found for this signature in database
GPG Key ID: 8EB056D53EECB12D

View File

@ -967,17 +967,17 @@ int lxc_devpts_terminal(int devpts_fd, int *ret_ptx, int *ret_pty,
if (errno == ENOSPC)
return systrace("Exceeded number of allocatable terminals");
return syserror("Failed to open terminal multiplexer device");
return syswarn("Failed to open terminal multiplexer device");
}
if (devpts_fd < 0) {
fd_devpts = open_at(-EBADF, "/dev/pts", PROTECT_OPATH_DIRECTORY,
PROTECT_LOOKUP_ABSOLUTE_XDEV, 0);
if (fd_devpts < 0)
return syserror("Failed to open devpts instance");
return syswarn("Failed to open devpts instance");
if (!same_device(fd_devpts, "ptmx", fd_ptx, ""))
return syserror("The acquired ptmx devices don't match");
return syswarn("The acquired ptmx devices don't match");
devpts_fd = fd_devpts;
}