summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2017-12-19 17:13:41 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2017-12-19 18:09:03 +0000
commit544f34505a03cd85e0b4d03c9b3d3add73c025ed (patch)
tree41e8348e29fd92883b8ecd85dbc05fd8479e1b40
parentb036e0fd770de1dd266db82dad196891746e92e1 (diff)
downloadillumos-joyent-544f34505a03cd85e0b4d03c9b3d3add73c025ed.tar.gz
OS-6521 zoneadmd loses stdio.log messages when init process does 0-byte write to stdout/stderrrelease-20171221
Reviewed by: Dan McDonald <danmcd@joyent.com> Reviewed by: Jason King <jason.king@joyent.com> Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r--usr/src/cmd/zoneadmd/zfd.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr/src/cmd/zoneadmd/zfd.c b/usr/src/cmd/zoneadmd/zfd.c
index 00278cd583..88501942e9 100644
--- a/usr/src/cmd/zoneadmd/zfd.c
+++ b/usr/src/cmd/zoneadmd/zfd.c
@@ -22,7 +22,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
- * Copyright 2016 Joyent, Inc. All rights reserved.
+ * Copyright 2017 Joyent, Inc.
*/
/*
@@ -934,7 +934,8 @@ do_zfd_io(int gzctlfd, int gzservfd, int gzerrfd, int stdinfd, int stdoutfd,
(POLLIN | POLLRDNORM | POLLRDBAND | POLLPRI)) {
errno = 0;
cc = read(stdoutfd, ibuf, BUFSIZ);
- if (cc <= 0 && (errno != EINTR) &&
+ /* zfd is a stream, so ignore 0 length read */
+ if (cc < 0 && (errno != EINTR) &&
(errno != EAGAIN))
break;
if (cc > 0) {
@@ -962,7 +963,8 @@ do_zfd_io(int gzctlfd, int gzservfd, int gzerrfd, int stdinfd, int stdoutfd,
(POLLIN | POLLRDNORM | POLLRDBAND | POLLPRI)) {
errno = 0;
cc = read(stderrfd, ibuf, BUFSIZ);
- if (cc <= 0 && (errno != EINTR) &&
+ /* zfd is a stream, so ignore 0 length read */
+ if (cc < 0 && (errno != EINTR) &&
(errno != EAGAIN))
break;
if (cc > 0) {