diff options
Diffstat (limited to 'lib/stream.c')
| -rw-r--r-- | lib/stream.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/lib/stream.c b/lib/stream.c index 55e7f64358..6c187bd359 100644 --- a/lib/stream.c +++ b/lib/stream.c @@ -54,7 +54,8 @@ DEFINE_MTYPE_STATIC(LIB, STREAM_FIFO, "Stream FIFO") * using stream_put..._at() functions. */ #define STREAM_WARN_OFFSETS(S) \ - zlog_warn("&(struct stream): %p, size: %lu, getp: %lu, endp: %lu\n", \ + flog_warn(EC_LIB_STREAM, \ + "&(struct stream): %p, size: %lu, getp: %lu, endp: %lu\n", \ (void *)(S), (unsigned long)(S)->size, \ (unsigned long)(S)->getp, (unsigned long)(S)->endp) @@ -68,16 +69,16 @@ DEFINE_MTYPE_STATIC(LIB, STREAM_FIFO, "Stream FIFO") #define STREAM_BOUND_WARN(S, WHAT) \ do { \ - zlog_warn("%s: Attempt to %s out of bounds", __func__, \ - (WHAT)); \ + flog_warn(EC_LIB_STREAM, "%s: Attempt to %s out of bounds", \ + __func__, (WHAT)); \ STREAM_WARN_OFFSETS(S); \ assert(0); \ } while (0) #define STREAM_BOUND_WARN2(S, WHAT) \ do { \ - zlog_warn("%s: Attempt to %s out of bounds", __func__, \ - (WHAT)); \ + flog_warn(EC_LIB_STREAM, "%s: Attempt to %s out of bounds", \ + __func__, (WHAT)); \ STREAM_WARN_OFFSETS(S); \ } while (0) @@ -85,7 +86,8 @@ DEFINE_MTYPE_STATIC(LIB, STREAM_FIFO, "Stream FIFO") #define CHECK_SIZE(S, Z) \ do { \ if (((S)->endp + (Z)) > (S)->size) { \ - zlog_warn( \ + flog_warn( \ + EC_LIB_STREAM, \ "CHECK_SIZE: truncating requested size %lu\n", \ (unsigned long)(Z)); \ STREAM_WARN_OFFSETS(S); \ @@ -270,7 +272,7 @@ void stream_forward_endp(struct stream *s, size_t size) } /* Copy from stream to destination. */ -inline bool stream_get2(void *dst, struct stream *s, size_t size) +bool stream_get2(void *dst, struct stream *s, size_t size) { STREAM_VERIFY_SANE(s); @@ -299,7 +301,7 @@ void stream_get(void *dst, struct stream *s, size_t size) } /* Get next character from the stream. */ -inline bool stream_getc2(struct stream *s, uint8_t *byte) +bool stream_getc2(struct stream *s, uint8_t *byte) { STREAM_VERIFY_SANE(s); @@ -344,7 +346,7 @@ uint8_t stream_getc_from(struct stream *s, size_t from) return c; } -inline bool stream_getw2(struct stream *s, uint16_t *word) +bool stream_getw2(struct stream *s, uint16_t *word) { STREAM_VERIFY_SANE(s); @@ -465,7 +467,7 @@ void stream_get_from(void *dst, struct stream *s, size_t from, size_t size) memcpy(dst, s->data + from, size); } -inline bool stream_getl2(struct stream *s, uint32_t *l) +bool stream_getl2(struct stream *s, uint32_t *l) { STREAM_VERIFY_SANE(s); @@ -966,8 +968,8 @@ ssize_t stream_read_try(struct stream *s, int fd, size_t size) /* Error: was it transient (return -2) or fatal (return -1)? */ if (ERRNO_IO_RETRY(errno)) return -2; - zlog_warn("%s: read failed on fd %d: %s", __func__, fd, - safe_strerror(errno)); + flog_err(EC_LIB_SOCKET, "%s: read failed on fd %d: %s", __func__, fd, + safe_strerror(errno)); return -1; } @@ -997,8 +999,8 @@ ssize_t stream_recvfrom(struct stream *s, int fd, size_t size, int flags, /* Error: was it transient (return -2) or fatal (return -1)? */ if (ERRNO_IO_RETRY(errno)) return -2; - zlog_warn("%s: read failed on fd %d: %s", __func__, fd, - safe_strerror(errno)); + flog_err(EC_LIB_SOCKET, "%s: read failed on fd %d: %s", __func__, fd, + safe_strerror(errno)); return -1; } |
