(fillcache, do_write): Revert the previous revision. The portability

issue applies only to sockets, and EWOULDBLOCK isn't defined on all
systems.
This commit is contained in:
Markus Armbruster 2005-11-26 18:36:48 +00:00
parent 9a296c4be3
commit 803009d0ce

View file

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