Unused since 3c269b51a6f03a1a678e8d
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/libvirt_private.syms | 1 -
src/util/virutil.c | 82 ----------------------------------------
src/util/virutil.h | 3 --
3 files changed, 86 deletions(-)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 23cbd27ce1..d61c772d1a 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -3225,7 +3225,6 @@ virMemoryMaxValue;
virParseNumber;
virParseOwnershipIds;
virParseVersionString;
-virPipeReadUntilEOF;
virScaleInteger;
virSetBlocking;
virSetCloseExec;
diff --git a/src/util/virutil.c b/src/util/virutil.c
index 0d58f1ee57..c0acf59831 100644
--- a/src/util/virutil.c
+++ b/src/util/virutil.c
@@ -191,88 +191,6 @@ int virSetSockReuseAddr(int fd, bool fatal)
}
#endif
-int
-virPipeReadUntilEOF(int outfd, int errfd,
- char **outbuf, char **errbuf) {
-
- struct pollfd fds[2];
- size_t i;
- bool finished[2];
-
- fds[0].fd = outfd;
- fds[0].events = POLLIN;
- fds[0].revents = 0;
- finished[0] = false;
- fds[1].fd = errfd;
- fds[1].events = POLLIN;
- fds[1].revents = 0;
- finished[1] = false;
-
- while (!(finished[0] && finished[1])) {
-
- if (poll(fds, ARRAY_CARDINALITY(fds), -1) < 0) {
- if ((errno == EAGAIN) || (errno == EINTR))
- continue;
- goto pollerr;
- }
-
- for (i = 0; i < ARRAY_CARDINALITY(fds); ++i) {
- char data[1024], **buf;
- int got, size;
-
- if (!(fds[i].revents))
- continue;
- else if (fds[i].revents & POLLHUP)
- finished[i] = true;
-
- if (!(fds[i].revents & POLLIN)) {
- if (fds[i].revents & POLLHUP)
- continue;
-
- virReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("Unknown poll response."));
- goto error;
- }
-
- got = read(fds[i].fd, data, sizeof(data));
-
- if (got == sizeof(data))
- finished[i] = false;
-
- if (got == 0) {
- finished[i] = true;
- continue;
- }
- if (got < 0) {
- if (errno == EINTR)
- continue;
- if (errno == EAGAIN)
- break;
- goto pollerr;
- }
-
- buf = ((fds[i].fd == outfd) ? outbuf : errbuf);
- size = (*buf ? strlen(*buf) : 0);
- if (VIR_REALLOC_N(*buf, size+got+1) < 0)
- goto error;
- memmove(*buf+size, data, got);
- (*buf)[size+got] = '\0';
- }
- continue;
-
- pollerr:
- virReportSystemError(errno,
- "%s", _("poll error"));
- goto error;
- }
-
- return 0;
-
- error:
- VIR_FREE(*outbuf);
- VIR_FREE(*errbuf);
- return -1;
-}
/* Convert C from hexadecimal character to integer. */
int
diff --git a/src/util/virutil.h b/src/util/virutil.h
index f8d8d85d27..a80e28b670 100644
--- a/src/util/virutil.h
+++ b/src/util/virutil.h
@@ -41,9 +41,6 @@ int virSetInherit(int fd, bool inherit) ATTRIBUTE_RETURN_CHECK;
int virSetCloseExec(int fd) ATTRIBUTE_RETURN_CHECK;
int virSetSockReuseAddr(int fd, bool fatal) ATTRIBUTE_RETURN_CHECK;
-int virPipeReadUntilEOF(int outfd, int errfd,
- char **outbuf, char **errbuf);
-
int virSetUIDGID(uid_t uid, gid_t gid, gid_t *groups, int ngroups);
int virSetUIDGIDWithCaps(uid_t uid, gid_t gid, gid_t *groups, int ngroups,
unsigned long long capBits,
--
2.20.1