From 8d2091aad42c6f6730b9d49e2043c0c6981938b9 Mon Sep 17 00:00:00 2001 From: Henning Brauer Date: Sat, 20 Dec 2003 14:33:10 +0000 Subject: read(2)/write(2) return ssize_t, not size_t --- usr.sbin/bgpd/bgpd.c | 4 ++-- usr.sbin/bgpd/bgpd.h | 18 +++++++++--------- usr.sbin/bgpd/buffer.c | 10 +++++----- usr.sbin/bgpd/imsg.c | 4 ++-- usr.sbin/bgpd/session.c | 16 ++++++++-------- 5 files changed, 26 insertions(+), 26 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/bgpd/bgpd.c b/usr.sbin/bgpd/bgpd.c index 2125ca1d6f8..e73df0b8429 100644 --- a/usr.sbin/bgpd/bgpd.c +++ b/usr.sbin/bgpd/bgpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpd.c,v 1.2 2003/12/17 19:26:26 henning Exp $ */ +/* $OpenBSD: bgpd.c,v 1.3 2003/12/20 14:33:09 henning Exp $ */ /* * Copyright (c) 2003 Henning Brauer @@ -308,7 +308,7 @@ dispatch_imsg(int fd, int idx, struct mrt_config *conf, struct buf *wbuf; struct mrtdump_config *m; struct imsg imsg; - size_t len; + ssize_t len; int n; if (get_imsg(fd, &imsg) > 0) { diff --git a/usr.sbin/bgpd/bgpd.h b/usr.sbin/bgpd/bgpd.h index acbceba3776..7797537f133 100644 --- a/usr.sbin/bgpd/bgpd.h +++ b/usr.sbin/bgpd/bgpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpd.h,v 1.1 2003/12/17 11:46:54 henning Exp $ */ +/* $OpenBSD: bgpd.h,v 1.2 2003/12/20 14:33:09 henning Exp $ */ /* * Copyright (c) 2003 Henning Brauer @@ -83,7 +83,7 @@ struct bgpd_config { struct peer_buf_read { u_char buf[MAX_PKTSIZE]; - size_t read_len; + ssize_t read_len; u_int16_t pkt_len; u_int8_t type; u_char *wptr; @@ -162,9 +162,9 @@ struct buf { struct peer *peer; int sock; u_char *buf; - size_t size; - size_t wpos; - size_t rpos; + ssize_t size; + ssize_t wpos; + ssize_t rpos; }; /* ipc messages */ @@ -174,7 +174,7 @@ struct buf { struct imsg_buf_read { u_char buf[MAX_IMSGSIZE]; - size_t read_len; + ssize_t read_len; u_int32_t peerid; u_int16_t pkt_len; u_int8_t type; @@ -227,9 +227,9 @@ enum suberr_update { int session_main(struct bgpd_config *, int[2], int[2]); /* buffer.c */ -struct buf *buf_open(struct peer *, int, size_t); -int buf_add(struct buf *, u_char *, size_t); -u_char *buf_reserve(struct buf *, size_t); +struct buf *buf_open(struct peer *, int, ssize_t); +int buf_add(struct buf *, u_char *, ssize_t); +u_char *buf_reserve(struct buf *, ssize_t); int buf_close(struct buf *); int buf_write(struct buf *); void buf_free(struct buf *buf); diff --git a/usr.sbin/bgpd/buffer.c b/usr.sbin/bgpd/buffer.c index 8fc324646d8..f93c2660ed6 100644 --- a/usr.sbin/bgpd/buffer.c +++ b/usr.sbin/bgpd/buffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: buffer.c,v 1.1 2003/12/17 11:46:54 henning Exp $ */ +/* $OpenBSD: buffer.c,v 1.2 2003/12/20 14:33:09 henning Exp $ */ /* * Copyright (c) 2003 Henning Brauer @@ -33,7 +33,7 @@ void buf_enqueue(struct buf *); void buf_dequeue(struct buf *); struct buf * -buf_open(struct peer *peer, int sock, size_t len) +buf_open(struct peer *peer, int sock, ssize_t len) { struct buf *buf; @@ -52,7 +52,7 @@ buf_open(struct peer *peer, int sock, size_t len) } int -buf_add(struct buf *buf, u_char *data, size_t len) +buf_add(struct buf *buf, u_char *data, ssize_t len) { if (buf->wpos + len > buf->size) return (-1); @@ -63,7 +63,7 @@ buf_add(struct buf *buf, u_char *data, size_t len) } u_char * -buf_reserve(struct buf *buf, size_t len) +buf_reserve(struct buf *buf, ssize_t len) { u_char *b; @@ -101,7 +101,7 @@ buf_close(struct buf *buf) int buf_write(struct buf *buf) { - size_t n; + ssize_t n; if ((n = write(buf->sock, buf->buf + buf->rpos, buf->size-buf->rpos)) == -1) { diff --git a/usr.sbin/bgpd/imsg.c b/usr.sbin/bgpd/imsg.c index 569c9a3a7f4..dc315dd277c 100644 --- a/usr.sbin/bgpd/imsg.c +++ b/usr.sbin/bgpd/imsg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: imsg.c,v 1.1 2003/12/17 11:46:54 henning Exp $ */ +/* $OpenBSD: imsg.c,v 1.2 2003/12/20 14:33:09 henning Exp $ */ /* * Copyright (c) 2003 Henning Brauer @@ -39,7 +39,7 @@ int get_imsg(int fd, struct imsg *imsg) { struct imsg_hdr *hdr; - size_t n, read_total = 0, datalen = 0; + ssize_t n, read_total = 0, datalen = 0; u_char *rptr; do { diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c index 33268ad3057..ada52e7676c 100644 --- a/usr.sbin/bgpd/session.c +++ b/usr.sbin/bgpd/session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: session.c,v 1.13 2003/12/19 21:41:04 henning Exp $ */ +/* $OpenBSD: session.c,v 1.14 2003/12/20 14:33:09 henning Exp $ */ /* * Copyright (c) 2003 Henning Brauer @@ -65,7 +65,7 @@ void session_open(struct peer *); void session_keepalive(struct peer *); void session_update(struct peer *); void session_notification(struct peer *, u_int8_t, u_int8_t, u_char *, - size_t); + ssize_t); int session_dispatch_msg(struct pollfd *, struct peer *); int parse_header(struct peer *, u_char *, u_int16_t *, u_int8_t *); int parse_open(struct peer *); @@ -790,8 +790,8 @@ session_keepalive(struct peer *peer) { struct msg_header msg; struct buf *buf; - size_t len; - int errs = 0; + ssize_t len; + int errs = 0; len = MSGSIZE_KEEPALIVE; @@ -829,12 +829,12 @@ session_update(struct peer *peer) void session_notification(struct peer *peer, u_int8_t errcode, u_int8_t subcode, - u_char *data, size_t datalen) + u_char *data, ssize_t datalen) { struct msg_header msg; struct buf *buf; - size_t len; - int errs = 0; + ssize_t len; + int errs = 0; len = MSGSIZE_NOTIFICATION_MIN + datalen; @@ -870,7 +870,7 @@ session_notification(struct peer *peer, u_int8_t errcode, u_int8_t subcode, int session_dispatch_msg(struct pollfd *pfd, struct peer *peer) { - size_t n, read_total; + ssize_t n, read_total; socklen_t len; int error; -- cgit v1.2.3