summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorajs <ajs>2005-02-24 16:02:53 +0000
committerajs <ajs>2005-02-24 16:02:53 +0000
commit81fb32404c942432d2bea1e50a4d53bf75fd0f70 (patch)
tree107d5d94061c110773c5b2985e383d2075bc6044 /lib
parent0d7e9134d828d5aee8c83960bb706a726cdc2ec4 (diff)
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')
-rw-r--r--lib/ChangeLog7
-rw-r--r--lib/stream.c7
-rw-r--r--lib/stream.h2
3 files changed, 13 insertions, 3 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog
index 26cb6862..ea561848 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,10 @@
+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).
+
2005-02-23 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* {vty.h,vty.c}: Remove vty_finish (duplicate of vty_reset).
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;
diff --git a/lib/stream.h b/lib/stream.h
index 54a16740..1f6c3772 100644
--- a/lib/stream.h
+++ b/lib/stream.h
@@ -196,7 +196,7 @@ int stream_empty (struct stream *); /* is the stream empty? */
u_char *stream_pnt (struct stream *);
/* Stream fifo. */
-struct stream_fifo *stream_fifo_new ();
+struct stream_fifo *stream_fifo_new (void);
void stream_fifo_push (struct stream_fifo *fifo, struct stream *s);
struct stream *stream_fifo_pop (struct stream_fifo *fifo);
struct stream *stream_fifo_head (struct stream_fifo *fifo);