(fillcache, do_write, io_input, io_output): Portability fix: always

check both EAGAIN and EWOULDBLOCK.  These are distinct on some
systems, e.g. HP-UX.
(io_output) [hpux]: Used to treat all errors as EWOULDBLOCK.  This
looks like a inept attempt to `fix' the above.  Remove.
This commit is contained in:
Markus Armbruster 2005-11-22 20:28:18 +00:00
parent 9113969208
commit edaa05b8cb
2 changed files with 4 additions and 11 deletions

View file

@ -276,7 +276,7 @@ fillcache(struct empfile *ep, int start)
while (n > 0) {
ret = read(ep->fd, p, n);
if (ret < 0) {
if (errno != EAGAIN) {
if (errno != EAGAIN && errno != EWOULDBLOCK) {
logerror("Error reading %s (%s)", ep->file, strerror(errno));
break;
}
@ -319,7 +319,7 @@ do_write(struct empfile *ep, void *buf, int id, int count)
while (n > 0) {
ret = write(ep->fd, p, n);
if (ret < 0) {
if (errno != EAGAIN) {
if (errno != EAGAIN && errno != EWOULDBLOCK) {
logerror("Error writing %s (%s)", ep->file, strerror(errno));
/* FIXME if this extended file, truncate back to old size */
return -1;