return log_error_errno(-1, errno, "Failed to receive devpts fd");
terminal->ptx = open_beneath(devpts_fd, "ptmx", O_RDWR | O_NOCTTY | O_CLOEXEC);
- if (terminal->ptx < 0)
- return log_error_errno(-1, errno, "Failed to open terminal multiplexer device");
+ if (terminal->ptx < 0) {
+ if (errno == ENOSPC)
+ return systrace("Exceeded number of allocatable terminals");
+
+ return syserror("Failed to open terminal multiplexer device");
+ }
ret = unlockpt(terminal->ptx);
if (ret < 0) {
SYSTRACE("Pure fd-based terminal allocation not possible");
break;
case ENOSPC:
- SYSTRACE("Exceeding number of allocatable terminals");
+ SYSTRACE("Exceeded number of allocatable terminals");
break;
default:
SYSWARN("Failed to allocate new pty device");