From 3bf2af7b40281f73d0e33ecca4095078feed07b1 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Sat, 14 Mar 2015 07:19:33 +0100 Subject: util: Remove unused functions Delete the unused functions qemu_signalfd_available(), qemu_send_full() and qemu_recv_full(). Signed-off-by: Thomas Huth Signed-off-by: Michael Tokarev --- util/osdep.c | 66 ------------------------------------------------------------ 1 file changed, 66 deletions(-) (limited to 'util/osdep.c') diff --git a/util/osdep.c b/util/osdep.c index b2bd154..f938b69 100644 --- a/util/osdep.c +++ b/util/osdep.c @@ -310,72 +310,6 @@ int qemu_accept(int s, struct sockaddr *addr, socklen_t *addrlen) return ret; } -/* - * A variant of send(2) which handles partial write. - * - * Return the number of bytes transferred, which is only - * smaller than `count' if there is an error. - * - * This function won't work with non-blocking fd's. - * Any of the possibilities with non-bloking fd's is bad: - * - return a short write (then name is wrong) - * - busy wait adding (errno == EAGAIN) to the loop - */ -ssize_t qemu_send_full(int fd, const void *buf, size_t count, int flags) -{ - ssize_t ret = 0; - ssize_t total = 0; - - while (count) { - ret = send(fd, buf, count, flags); - if (ret < 0) { - if (errno == EINTR) { - continue; - } - break; - } - - count -= ret; - buf += ret; - total += ret; - } - - return total; -} - -/* - * A variant of recv(2) which handles partial write. - * - * Return the number of bytes transferred, which is only - * smaller than `count' if there is an error. - * - * This function won't work with non-blocking fd's. - * Any of the possibilities with non-bloking fd's is bad: - * - return a short write (then name is wrong) - * - busy wait adding (errno == EAGAIN) to the loop - */ -ssize_t qemu_recv_full(int fd, void *buf, size_t count, int flags) -{ - ssize_t ret = 0; - ssize_t total = 0; - - while (count) { - ret = qemu_recv(fd, buf, count, flags); - if (ret <= 0) { - if (ret < 0 && errno == EINTR) { - continue; - } - break; - } - - count -= ret; - buf += ret; - total += ret; - } - - return total; -} - void qemu_set_version(const char *version) { qemu_version = version; -- cgit v1.1