mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-17 16:06:00 +00:00
Merge pull request #3907 from brauner/2021-07-15.fixes.3
terminal: log TIOCGPTPEER failure less alarmingly
This commit is contained in:
commit
8cff10d6a8
@ -121,6 +121,9 @@ int lxc_abstract_unix_send_fds_iov(int fd, const int *sendfds, int num_sendfds,
|
|||||||
struct cmsghdr *cmsg = NULL;
|
struct cmsghdr *cmsg = NULL;
|
||||||
size_t cmsgbufsize = CMSG_SPACE(num_sendfds * sizeof(int));
|
size_t cmsgbufsize = CMSG_SPACE(num_sendfds * sizeof(int));
|
||||||
|
|
||||||
|
if (num_sendfds <= 0)
|
||||||
|
return ret_errno(EINVAL);
|
||||||
|
|
||||||
cmsgbuf = malloc(cmsgbufsize);
|
cmsgbuf = malloc(cmsgbufsize);
|
||||||
if (!cmsgbuf)
|
if (!cmsgbuf)
|
||||||
return ret_errno(-ENOMEM);
|
return ret_errno(-ENOMEM);
|
||||||
|
@ -931,7 +931,17 @@ static int lxc_terminal_create_native(const char *name, const char *lxcpath, str
|
|||||||
|
|
||||||
terminal->pty = ioctl(terminal->ptx, TIOCGPTPEER, O_RDWR | O_NOCTTY | O_CLOEXEC);
|
terminal->pty = ioctl(terminal->ptx, TIOCGPTPEER, O_RDWR | O_NOCTTY | O_CLOEXEC);
|
||||||
if (terminal->pty < 0) {
|
if (terminal->pty < 0) {
|
||||||
SYSWARN("Failed to allocate new pty device");
|
switch (errno) {
|
||||||
|
case ENOTTY:
|
||||||
|
SYSTRACE("Pure fd-based terminal allocation not possible");
|
||||||
|
break;
|
||||||
|
case ENOSPC:
|
||||||
|
SYSTRACE("Exceeding number of allocatable terminals");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
SYSWARN("Failed to allocate new pty device");
|
||||||
|
break;
|
||||||
|
}
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user