zerofree.c
guestfsd_LDADD = \
libprotocol.a \
- lib/libgnu.a $(LIB_CLOCK_GETTIME)
+ lib/libgnu.a \
+ $(GETADDRINFO_LIB) \
+ $(HOSTENT_LIB) \
+ $(INET_NTOP_LIB) \
+ $(LIBSOCKET) \
+ $(LIB_CLOCK_GETTIME) \
+ $(LIBINTL) \
+ $(SERVENT_LIB)
AM_CPPFLAGS = -I$(srcdir)/lib -Ilib
guestfsd_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
#include <netdb.h>
#include <sys/select.h>
#include <sys/wait.h>
+#include <arpa/inet.h>
+#include <netinet/in.h>
#ifdef HAVE_PRINTF_H
# include <printf.h>
#endif
+#include "sockets.h"
#include "c-ctype.h"
#include "ignore-value.h"
+#include "error.h"
#include "daemon.h"
}
#endif /* WIN32 */
+#ifdef WIN32
+static int
+winsock_init (void)
+{
+ int r;
+
+ /* http://msdn2.microsoft.com/en-us/library/ms742213.aspx */
+ r = gl_sockets_startup (SOCKETS_2_2);
+ return r == 0 ? 0 : -1;
+}
+#else /* !WIN32 */
+static int
+winsock_init (void)
+{
+ return 0;
+}
+#endif /* !WIN32 */
+
/* Location to mount root device. */
const char *sysroot = "/sysroot"; /* No trailing slash. */
int sysroot_len = 8;
char *cmdline;
char *vmchannel = NULL;
+ if (winsock_init () == -1)
+ error (EXIT_FAILURE, 0, "winsock initialization failed");
+
#ifdef HAVE_REGISTER_PRINTF_SPECIFIER
/* http://udrepper.livejournal.com/20948.html */
register_printf_specifier ('Q', print_shell_quote, print_arginfo);
# Specification in the form of a command-line invocation:
-# gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --with-tests --no-libtool --macro-prefix=gl byteswap c-ctype fsusage futimens getaddrinfo getline glob hash ignore-value manywarnings mkdtemp netdb openat perror pread readlink select sleep strchrnul strndup sys_select sys_wait vasprintf warnings
+# gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --with-tests --no-libtool --macro-prefix=gl byteswap c-ctype connect fsusage futimens getaddrinfo getline glob hash ignore-value manywarnings mkdtemp netdb openat perror pread readlink select sleep socket strchrnul strndup symlinkat sys_select sys_wait vasprintf warnings
# Specification in the form of a few gnulib-tool.m4 macro invocations:
gl_LOCAL_DIR([])
gl_MODULES([
byteswap
c-ctype
+ connect
fsusage
futimens
getaddrinfo
readlink
select
sleep
+ socket
strchrnul
strndup
+ symlinkat
sys_select
sys_wait
vasprintf