mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-06 10:54:47 +00:00
2004-11-07 Paul Jakma <paul@dishone.st>
* buffer.c: Add missing include of log.h. (buffer_flush_available) written is compared against mostly against unsigned types, only for the writev do we need signed compare, so declare it as size_t and cast it to ssize_t just for the error compare when we've called writev. * buffer.h: Add comment that buffer data sizes really should be size_t.
This commit is contained in:
parent
3e6064f838
commit
2265d20c1a
@ -1,6 +1,16 @@
|
|||||||
2004-11-07 Paul Jakma <paul@dishone.st>
|
2004-11-07 Paul Jakma <paul@dishone.st>
|
||||||
|
|
||||||
* lib/version.h.in: add autoconf configure_input output var
|
* buffer.c: Add missing include of log.h.
|
||||||
|
(buffer_flush_available) written is compared against
|
||||||
|
mostly against unsigned types, only for the writev do we need
|
||||||
|
signed compare, so declare it as size_t and cast it to ssize_t
|
||||||
|
just for the error compare when we've called writev.
|
||||||
|
* buffer.h: Add comment that buffer data sizes really should be
|
||||||
|
size_t.
|
||||||
|
|
||||||
|
2004-11-07 Paul Jakma <paul@dishone.st>
|
||||||
|
|
||||||
|
* version.h.in: add autoconf configure_input output var
|
||||||
|
|
||||||
2004-11-04 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
|
2004-11-04 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "buffer.h"
|
#include "buffer.h"
|
||||||
|
#include "log.h"
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
/* Make buffer data. */
|
/* Make buffer data. */
|
||||||
@ -580,9 +581,9 @@ in one shot. */
|
|||||||
|
|
||||||
struct buffer_data *d;
|
struct buffer_data *d;
|
||||||
struct buffer_data *next;
|
struct buffer_data *next;
|
||||||
ssize_t written;
|
size_t written;
|
||||||
struct iovec iov[MAX_CHUNKS];
|
struct iovec iov[MAX_CHUNKS];
|
||||||
int iovcnt = 0;
|
size_t iovcnt = 0;
|
||||||
size_t nbyte = 0;
|
size_t nbyte = 0;
|
||||||
|
|
||||||
for (d = b->head; d && (iovcnt < MAX_CHUNKS) && (nbyte < MAX_FLUSH);
|
for (d = b->head; d && (iovcnt < MAX_CHUNKS) && (nbyte < MAX_FLUSH);
|
||||||
@ -592,7 +593,8 @@ in one shot. */
|
|||||||
nbyte += (iov[iovcnt].iov_len = d->cp-d->sp);
|
nbyte += (iov[iovcnt].iov_len = d->cp-d->sp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((written = writev(fd,iov,iovcnt)) < 0)
|
/* only place where written should be sign compared */
|
||||||
|
if ((ssize_t)(written = writev(fd,iov,iovcnt)) < 0)
|
||||||
{
|
{
|
||||||
if ((errno != EAGAIN) && (errno != EINTR))
|
if ((errno != EAGAIN) && (errno != EINTR))
|
||||||
zlog_warn("buffer_flush_available write error on fd %d: %s",
|
zlog_warn("buffer_flush_available write error on fd %d: %s",
|
||||||
|
@ -29,7 +29,8 @@ struct buffer
|
|||||||
/* Data list. */
|
/* Data list. */
|
||||||
struct buffer_data *head;
|
struct buffer_data *head;
|
||||||
struct buffer_data *tail;
|
struct buffer_data *tail;
|
||||||
|
|
||||||
|
/* XXX: These unsigned longs should be size_t's */
|
||||||
/* Current allocated data. */
|
/* Current allocated data. */
|
||||||
unsigned long alloc;
|
unsigned long alloc;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user