806
806
nih_message ("XXX: hello from log_read_watch");
812
flags = fcntl (log->io->watch->fd, F_GETFL);
813
nih_message ("fd=%d, flags=%d, errno=%d\n", log->io->watch->fd, flags, errno);
809
817
nih_debug ("%s: line %d", __func__, __LINE__);
810
818
/* Ensure we have some space to read data from the job */
833
841
nih_debug ("%s: line %d", __func__, __LINE__);
845
if (! (saved == EIO || saved == EBADF))
848
/* Either the job process end of the pty has
849
* been closed (EIO / EBADF), or there really
850
* is no (more) data to be read.
836
854
nih_debug ("%s: log: line=%d, errno=%d",
837
855
__func__, __LINE__, saved);
839
/* Expected error caused by attempting to
840
* read from the pty after the job at
841
* the remote end has exited.
843
if (saved == EIO || saved == EBADF) {
844
nih_debug ("%s: line %d", __func__, __LINE__);
846
nih_debug ("%s: line %d", __func__, __LINE__);
849
nih_debug ("%s: line %d", __func__, __LINE__);
851
/* Probably EINTR/EAGAIN. Since we're using
852
* non-blocking I/O, retry.
856
nih_debug ("%s: line %d", __func__, __LINE__);
857
/* Nothing more to read */
860
nih_debug ("%s: line %d", __func__, __LINE__);
862
nih_debug ("%s: line %d", __func__, __LINE__);