summaryrefslogtreecommitdiff
path: root/src/basic/util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-09-01 19:39:14 +0200
committerLennart Poettering <lennart@poettering.net>2015-09-01 20:40:24 +0200
commit395745ba533ac91fe118f43ec83f13a752c0b473 (patch)
tree55fa10dc719b9d605e82be61bb4448ef17a6365f /src/basic/util.c
parentfc94c3260549c12892461be031c4b9dc122ca1ef (diff)
machined: call unlockpt() in container, not host
It makes assumptions about the pty path, hence better call it in the container namespace rather than the host.
Diffstat (limited to 'src/basic/util.c')
-rw-r--r--src/basic/util.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/basic/util.c b/src/basic/util.c
index 737f2a221c..f01f5f237b 100644
--- a/src/basic/util.c
+++ b/src/basic/util.c
@@ -6095,6 +6095,9 @@ int openpt_in_namespace(pid_t pid, int flags) {
if (master < 0)
_exit(EXIT_FAILURE);
+ if (unlockpt(master) < 0)
+ _exit(EXIT_FAILURE);
+
cmsg = CMSG_FIRSTHDR(&mh);
cmsg->cmsg_level = SOL_SOCKET;
cmsg->cmsg_type = SCM_RIGHTS;