diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2004-09-15 00:05:30 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2004-09-15 00:05:30 +0000 |
commit | 1ae8dbdacf4ee9a69dc67092b325b7d7ff02203b (patch) | |
tree | c1f6eda9fcb3b5c5d8eb8ba0af11c22f06965b97 /usr.sbin | |
parent | 048b03e6d61c596b299bf0a8a8528a8fdc398bfa (diff) |
remove buf_write(), not used in ntpd. found by theo
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ntpd/buffer.c | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/usr.sbin/ntpd/buffer.c b/usr.sbin/ntpd/buffer.c index 88d9c4f23dc..7bb9974a4f0 100644 --- a/usr.sbin/ntpd/buffer.c +++ b/usr.sbin/ntpd/buffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: buffer.c,v 1.3 2004/08/10 19:18:23 henning Exp $ */ +/* $OpenBSD: buffer.c,v 1.4 2004/09/15 00:05:29 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -28,7 +28,6 @@ #include "ntpd.h" -int buf_write(int, struct buf *); void buf_enqueue(struct msgbuf *, struct buf *); void buf_dequeue(struct msgbuf *, struct buf *); @@ -66,31 +65,6 @@ buf_close(struct msgbuf *msgbuf, struct buf *buf) return (1); } -int -buf_write(int sock, struct buf *buf) -{ - ssize_t n; - - if ((n = write(sock, buf->buf + buf->rpos, - buf->size - buf->rpos)) == -1) { - if (errno == EAGAIN) /* cannot write immediately */ - return (0); - else - return (-1); - } - - if (n == 0) { /* connection closed */ - errno = 0; - return (-2); - } - - if (n < buf->size - buf->rpos) { /* not all data written yet */ - buf->rpos += n; - return (0); - } else - return (1); -} - void buf_free(struct buf *buf) { |