mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
src: replace WSAStartup with g_networking_init()
g_networking_init() does the same as our custom code. Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
26d9748ff1
commit
f6a750e678
@ -24,7 +24,7 @@ AC_DEFUN([LIBVIRT_ARG_GLIB], [
|
||||
AC_DEFUN([LIBVIRT_CHECK_GLIB],[
|
||||
GLIB_REQUIRED=2.48.0
|
||||
|
||||
LIBVIRT_CHECK_PKG([GLIB], [glib-2.0 gobject-2.0], [$GLIB_REQUIRED])
|
||||
LIBVIRT_CHECK_PKG([GLIB], [glib-2.0 gobject-2.0 gio-2.0], [$GLIB_REQUIRED])
|
||||
|
||||
if test "$with_glib" = "no" ; then
|
||||
AC_MSG_ERROR([glib-2.0, gobject-2.0 >= $GLIB_REQUIRED are required for libvirt])
|
||||
|
@ -26,15 +26,12 @@
|
||||
#include <unistd.h>
|
||||
#include <sys/wait.h>
|
||||
#include <time.h>
|
||||
#include <gio/gnetworking.h>
|
||||
|
||||
#include <libxml/parser.h>
|
||||
#include <libxml/xpath.h>
|
||||
#include "getpass.h"
|
||||
|
||||
#ifdef HAVE_WINSOCK2_H
|
||||
# include <winsock2.h>
|
||||
#endif
|
||||
|
||||
#ifdef WITH_CURL
|
||||
# include <curl/curl.h>
|
||||
#endif
|
||||
@ -211,21 +208,6 @@ static virConnectAuth virConnectAuthDefault = {
|
||||
*/
|
||||
virConnectAuthPtr virConnectAuthPtrDefault = &virConnectAuthDefault;
|
||||
|
||||
#if HAVE_WINSOCK2_H
|
||||
static int
|
||||
virWinsockInit(void)
|
||||
{
|
||||
WORD winsock_version, err;
|
||||
WSADATA winsock_data;
|
||||
|
||||
/* http://msdn2.microsoft.com/en-us/library/ms742213.aspx */
|
||||
winsock_version = MAKEWORD(2, 2);
|
||||
err = WSAStartup(winsock_version, &winsock_data);
|
||||
return err == 0 ? 0 : -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static bool virGlobalError;
|
||||
static virOnceControl virGlobalOnce = VIR_ONCE_CONTROL_INITIALIZER;
|
||||
|
||||
@ -261,10 +243,7 @@ virGlobalInit(void)
|
||||
|
||||
VIR_DEBUG("register drivers");
|
||||
|
||||
#if HAVE_WINSOCK2_H
|
||||
if (virWinsockInit() == -1)
|
||||
goto error;
|
||||
#endif
|
||||
g_networking_init();
|
||||
|
||||
#ifdef HAVE_LIBINTL_H
|
||||
if (!bindtextdomain(PACKAGE, LOCALEDIR))
|
||||
|
Loading…
x
Reference in New Issue
Block a user