summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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)