From 594cd20f7629b0d84267f02458963d7586715516 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 25 Jun 2017 12:00:52 +0200 Subject: [PATCH] client: Remove unused ring_to_file() Signed-off-by: Markus Armbruster --- src/client/ringbuf.c | 21 --------------------- src/client/ringbuf.h | 1 - 2 files changed, 22 deletions(-) diff --git a/src/client/ringbuf.c b/src/client/ringbuf.c index 638c9e4c7..2e4c88575 100644 --- a/src/client/ringbuf.c +++ b/src/client/ringbuf.c @@ -240,24 +240,3 @@ ring_to_iovec(struct ring *r, struct iovec iov[]) iov[1].iov_len = prod; return 2; } - -/* - * Drain ring buffer to file referred by file descriptor @fd. - * If ring buffer is already empty, do nothing and return 0. - * Else attempt to write complete contents with writev(), and return - * its value. - */ -int -ring_to_file(struct ring *r, int fd) -{ - struct iovec iov[2]; - int cnt; - ssize_t res; - - cnt = ring_to_iovec(r, iov); - res = writev(fd, iov, cnt); - if (res < 0) - return res; - ring_discard(r, res); - return res; -} diff --git a/src/client/ringbuf.h b/src/client/ringbuf.h index 8d16f0cca..545a2fd36 100644 --- a/src/client/ringbuf.h +++ b/src/client/ringbuf.h @@ -63,6 +63,5 @@ extern void ring_discard(struct ring *, int); extern int ring_search(struct ring *, char *, int); extern int ring_from_file(struct ring *, int fd); extern int ring_to_iovec(struct ring *, struct iovec[]); -extern int ring_to_file(struct ring *, int fd); #endif -- 2.43.0