From: Lennart Poettering Date: Sat, 5 Sep 2015 18:24:52 +0000 (+0200) Subject: machine: make sure to call unlockpt() even for local host pty connections X-Git-Tag: v226~19^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5f430ff76e8e5f7ca5b7ef67dd3b205487a0f41b;p=thirdparty%2Fsystemd.git 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 --- diff --git a/src/machine/machine.c b/src/machine/machine.c index 0d1b119dc1b..a056ec3b080 100644 --- a/src/machine/machine.c +++ b/src/machine/machine.c @@ -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)