summaryrefslogtreecommitdiffstats
path: root/lib/stream.c
diff options
context:
space:
mode:
authorajs <ajs>2005-02-24 16:02:53 +0000
committerajs <ajs>2005-02-24 16:02:53 +0000
commit8f79a0eeba9a1b1758b070380c4ba34d7cf9957b (patch)
tree12231e86e906563d537b2b4a8c68ea72ae52e4c5 /lib/stream.c
parent6648e445259a4f4dc4a2a1019a8bc11e28110cdd (diff)
downloadquagga-8f79a0eeba9a1b1758b070380c4ba34d7cf9957b.tar.bz2
quagga-8f79a0eeba9a1b1758b070380c4ba34d7cf9957b.tar.xz
2005-02-24 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* stream.c: (stream_read_try) Log a warning message if a fatal I/O error occurs. (stream_fifo_new) Fix prototype. * stream.h: Fix prototype for stream_fifo_new (need void arg).
Diffstat (limited to 'lib/stream.c')
-rw-r--r--lib/stream.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/stream.c b/lib/stream.c
index 821ad6e5..b71b8ee9 100644
--- a/lib/stream.c
+++ b/lib/stream.c
@@ -624,7 +624,10 @@ stream_read_try(struct stream *s, int fd, size_t size)
return nbytes;
}
/* Error: was it transient (return -2) or fatal (return -1)? */
- return ERRNO_IO_RETRY(errno) ? -2 : -1;
+ if (ERRNO_IO_RETRY(errno))
+ return -2;
+ zlog_warn("%s: read failed on fd %d: %s", __func__, fd, safe_strerror(errno));
+ return -1;
}
/* Read up to smaller of size or SIZE_REMAIN() bytes to the stream, starting
@@ -729,7 +732,7 @@ stream_flush (struct stream *s, int fd)
/* Stream first in first out queue. */
struct stream_fifo *
-stream_fifo_new ()
+stream_fifo_new (void)
{
struct stream_fifo *new;