summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorJason King <jasonbking@users.noreply.github.com>2020-01-02 17:52:20 -0600
committerGitHub <noreply@github.com>2020-01-02 17:52:20 -0600
commitfc356053b6fcdfb2eb1f9353e1b7e5332fbfcaf8 (patch)
tree50aa34e7a79f83f86310f1492574fe8080fda73b /usr/src
parent127353ace231c5cee85ffb52d0afeb86a42d748f (diff)
downloadillumos-joyent-fc356053b6fcdfb2eb1f9353e1b7e5332fbfcaf8.tar.gz
OS-8083 zlogin -I now hangs at zone stop (#247)release-20200102
Reviewed by: Mike Gerdts <mike.gerdts@joyent.com> Approved by: Mike Gerdts <mike.gerdts@joyent.com>
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/cmd/zlogin/zlogin.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr/src/cmd/zlogin/zlogin.c b/usr/src/cmd/zlogin/zlogin.c
index 1b49fc221f..f2da6a3d74 100644
--- a/usr/src/cmd/zlogin/zlogin.c
+++ b/usr/src/cmd/zlogin/zlogin.c
@@ -22,9 +22,8 @@
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2013 DEY Storage Systems, Inc.
* Copyright (c) 2014 Gary Mills
- * Copyright 2016 Joyent, Inc.
* Copyright 2015 Nexenta Systems, Inc. All rights reserved.
- * Copyright 2019 Joyent, Inc.
+ * Copyright 2020 Joyent, Inc.
* Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
*/
@@ -941,6 +940,9 @@ doio(int stdin_fd, int appin_fd, int stdout_fd, int stderr_fd, int sig_fd,
/* event from master side stderr */
if (pollfds[1].revents) {
+ if (pollfds[1].revents & POLLHUP)
+ break;
+
if (pollfds[1].revents &
(POLLIN | POLLRDNORM | POLLRDBAND | POLLPRI)) {
if (process_output(stderr_fd, STDERR_FILENO)
@@ -954,6 +956,9 @@ doio(int stdin_fd, int appin_fd, int stdout_fd, int stderr_fd, int sig_fd,
/* event from master side stdout */
if (pollfds[0].revents) {
+ if (pollfds[0].revents & POLLHUP)
+ break;
+
if (pollfds[0].revents &
(POLLIN | POLLRDNORM | POLLRDBAND | POLLPRI)) {
if (process_output(stdout_fd, STDOUT_FILENO)