* Europagate, 1995
*
* $Log: gip.c,v $
- * Revision 1.5 1995/05/01 16:27:28 adam
+ * Revision 1.6 1995/05/02 15:26:52 adam
+ * EINTR obvserved on reads and writes.
+ *
+ * Revision 1.5 1995/05/01 16:27:28 adam
* Various improvements. Close-on-exec and close on failure on either
* read or write FIFO.
*
int r, no = 0;
while (no < count)
{
- r = read (gip->rfd, buf+no, count-no);
- if (r == -1)
- {
- gip->errno = errno;
- return -1;
- }
+ while (1)
+ {
+ r = read (gip->rfd, buf+no, count-no);
+ if (r != -1)
+ break;
+ if (errno != EINTR)
+ {
+ gip->errno = errno;
+ return -1;
+ }
+ }
no += r;
}
return 0;
int r, no = 0;
while (no < count)
{
- r = write (gip->wfd, buf+no, count-no);
- if (r == -1)
- {
- gip->errno = errno;
- return -1;
+ while (1)
+ {
+ r = write (gip->wfd, buf+no, count-no);
+ if (r != -1)
+ break;
+ if (errno != EINTR)
+ {
+ gip->errno = errno;
+ return -1;
+ }
}
no += r;
}
* Europagate, 1995
*
* $Log: lgets.c,v $
- * Revision 1.1 1995/05/01 12:43:58 adam
+ * Revision 1.2 1995/05/02 15:26:52 adam
+ * EINTR obvserved on reads and writes.
+ *
+ * Revision 1.1 1995/05/01 12:43:58 adam
* lgets function moved from kernel to util.
*
*/
--max;
while (no <= max)
{
- if ((r=read (fd, buf+no, 1)) != 1)
- {
+ while (1)
+ {
+ if ((r=read (fd, buf+no, 1)) == 1)
+ break;
+ if (r == -1 && errno == EINTR)
+ continue;
if (r == -1)
gw_log (GW_LOG_WARN|GW_LOG_ERRNO, "lgets", "read fail");
else