summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2015-01-14 19:08:38 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2015-01-14 19:08:38 +0000
commit4d9fc8b0b38cb69d7f951722ae8723137f994686 (patch)
tree552c088103c0e1570228e50e157190e6e0548945
parent54925032d3aac7ef614d1796cd8569c6644d57f2 (diff)
downloadillumos-joyent-4d9fc8b0b38cb69d7f951722ae8723137f994686.tar.gz
OS-3713 fcntl called with PID 1 in an LX container fails with "No such process"
-rw-r--r--usr/src/lib/brand/lx/lx_brand/common/fcntl.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/usr/src/lib/brand/lx/lx_brand/common/fcntl.c b/usr/src/lib/brand/lx/lx_brand/common/fcntl.c
index b1d999aea7..8ec871294f 100644
--- a/usr/src/lib/brand/lx/lx_brand/common/fcntl.c
+++ b/usr/src/lib/brand/lx/lx_brand/common/fcntl.c
@@ -22,7 +22,7 @@
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
- * Copyright 2014 Joyent, Inc. All rights reserved.
+ * Copyright 2015 Joyent, Inc. All rights reserved.
*/
#include <sys/types.h>
@@ -230,11 +230,20 @@ lx_fcntl_com(int fd, int cmd, ulong_t arg)
break;
case LX_F_SETOWN:
+ if ((int)arg == 1) {
+ /* Setown for the init process uses the real pid. */
+ arg = (ulong_t)zoneinit_pid;
+ }
+
rc = fcntl(fd, F_SETOWN, arg);
break;
case LX_F_GETOWN:
rc = fcntl(fd, F_GETOWN, arg);
+ if (rc == zoneinit_pid) {
+ /* Getown for the init process returns 1. */
+ rc = 1;
+ }
break;
default: