1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-25 18:50:18 +03:00

machine: make sure to call unlockpt() even for local host pty connections

This fixes breakage for local host pty handling, introduced in
395745ba533ac91fe118f43ec83f13a752c0b473.

Fixes #1139
This commit is contained in:
Lennart Poettering 2015-09-05 20:24:52 +02:00
parent 91b3e7fb6c
commit 5f430ff76e

View File

@ -547,8 +547,18 @@ int machine_openpt(Machine *m, int flags) {
switch (m->class) {
case MACHINE_HOST:
return posix_openpt(flags);
case MACHINE_HOST: {
int fd;
fd = posix_openpt(flags);
if (fd < 0)
return -errno;
if (unlockpt(fd) < 0)
return -errno;
return fd;
}
case MACHINE_CONTAINER:
if (m->leader <= 0)