summaryrefslogtreecommitdiff
path: root/src/machine
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-09-07 02:59:08 +0200
committerTom Gundersen <teg@jklm.no>2015-09-07 02:59:08 +0200
commit6167a91c745e5406164ef57e27212ba572d9a0dc (patch)
tree35af349cc76d850d1593163d8dabfd4c59dfe267 /src/machine
parent2009bcfd23400bacd50848ac3e72cd5f6fbe53db (diff)
parent08acb521f30d692f13056daa23fb1323528249ff (diff)
Merge pull request #1165 from poettering/nspawn-files
various fixes to the core, logind, machined, nspawn
Diffstat (limited to 'src/machine')
-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)