提交 f6a750e6 编写于 作者: D Daniel P. Berrangé

src: replace WSAStartup with g_networking_init()

g_networking_init() does the same as our custom code.
Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com>
Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 26d9748f
......@@ -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))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册