summaryrefslogtreecommitdiff
path: root/io
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2017-12-21 12:55:20 +0000
committerDaniel P. Berrangé <berrange@redhat.com>2018-03-13 18:06:06 +0000
commit58dc31f1a7dc6cd0f21bd51a34011ba366d36e53 (patch)
tree9bd13cbc470c53428618096546c042590ebbdc2f /io
parentabd983c0e0beb4b15326e51a837e1b5177df0e08 (diff)
sockets: move fd_is_socket() into common sockets code
The fd_is_socket() helper method is useful in a few places, so put it in the common sockets code. Make the code more compact while moving it. Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'io')
-rw-r--r--io/channel-util.c13
1 files changed, 0 insertions, 13 deletions
diff --git a/io/channel-util.c b/io/channel-util.c
index 0fb4bd0837..423d79845a 100644
--- a/io/channel-util.c
+++ b/io/channel-util.c
@@ -24,19 +24,6 @@
#include "io/channel-socket.h"
-static bool fd_is_socket(int fd)
-{
- int optval;
- socklen_t optlen;
- optlen = sizeof(optval);
- return qemu_getsockopt(fd,
- SOL_SOCKET,
- SO_TYPE,
- (char *)&optval,
- &optlen) == 0;
-}
-
-
QIOChannel *qio_channel_new_fd(int fd,
Error **errp)
{