client: Remove unused ring_to_file()

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2017-06-25 12:00:52 +02:00
parent b3383c7423
commit 594cd20f76
2 changed files with 0 additions and 22 deletions

View file

@ -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;
}

View file

@ -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