summaryrefslogtreecommitdiff
path: root/src/machine/machine.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-09-05 20:24:52 +0200
committerLennart Poettering <lennart@poettering.net>2015-09-05 20:27:52 +0200
commit5f430ff76e8e5f7ca5b7ef67dd3b205487a0f41b (patch)
tree3f4cca38bf6ca82f44ad8cb0c3f9fa9fd7fa8c4e /src/machine/machine.c
parent91b3e7fb6c0b24a8d258c710304d50a45f90568a (diff)
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
Diffstat (limited to 'src/machine/machine.c')
-rw-r--r--src/machine/machine.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/machine/machine.c b/src/machine/machine.c
index 0d1b119dc1..a056ec3b08 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)