projects
/
egate.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
3061b86
)
EINTR obvserved on reads and writes.
author
Adam Dickmeiss
<adam@indexdata.dk>
Tue, 2 May 1995 15:26:52 +0000
(15:26 +0000)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Tue, 2 May 1995 15:26:52 +0000
(15:26 +0000)
util/gip.c
patch
|
blob
|
history
util/lgets.c
patch
|
blob
|
history
diff --git
a/util/gip.c
b/util/gip.c
index
f0c02a4
..
8265d49
100644
(file)
--- a/
util/gip.c
+++ b/
util/gip.c
@@
-2,7
+2,10
@@
* Europagate, 1995
*
* $Log: gip.c,v $
* 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.
*
* Various improvements. Close-on-exec and close on failure on either
* read or write FIFO.
*
@@
-83,12
+86,17
@@
int gip_read (GIP gip, char *buf, size_t count)
int r, no = 0;
while (no < count)
{
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;
no += r;
}
return 0;
@@
-99,11
+107,16
@@
int gip_write (GIP gip, const char *buf, size_t count)
int r, no = 0;
while (no < count)
{
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;
}
}
no += r;
}
diff --git
a/util/lgets.c
b/util/lgets.c
index
77e5b49
..
9b9285b
100644
(file)
--- a/
util/lgets.c
+++ b/
util/lgets.c
@@
-2,7
+2,10
@@
* Europagate, 1995
*
* $Log: lgets.c,v $
* 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.
*
*/
* lgets function moved from kernel to util.
*
*/
@@
-24,8
+27,12
@@
int lgets (char *buf, int max, int fd)
--max;
while (no <= max)
{
--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
if (r == -1)
gw_log (GW_LOG_WARN|GW_LOG_ERRNO, "lgets", "read fail");
else