From fc356053b6fcdfb2eb1f9353e1b7e5332fbfcaf8 Mon Sep 17 00:00:00 2001 From: Jason King Date: Thu, 2 Jan 2020 17:52:20 -0600 Subject: OS-8083 zlogin -I now hangs at zone stop (#247) Reviewed by: Mike Gerdts Approved by: Mike Gerdts --- usr/src/cmd/zlogin/zlogin.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'usr/src') 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) -- cgit v1.2.3