AC_CHECK_FUNCS([strerror_r strtok_r getmntent_r getgrnam_r getpwuid_r])
dnl Availability of various common headers (non-fatal if missing).
-AC_CHECK_HEADERS([pwd.h paths.h regex.h sys/syslimits.h sys/utsname.h sys/wait.h winsock2.h sched.h termios.h sys/poll.h syslog.h mntent.h])
+AC_CHECK_HEADERS([pwd.h paths.h regex.h sys/syslimits.h sys/utsname.h sys/wait.h winsock2.h sched.h termios.h sys/poll.h syslog.h mntent.h net/ethernet.h])
dnl Where are the XDR functions?
dnl If portablexdr is installed, prefer that.
#include <config.h>
+#include <sys/types.h>
+#include <sys/stat.h>
#include <fcntl.h>
#include <dirent.h>
-#include <net/ethernet.h>
+#if HAVE_NET_ETHERNET_H
+# include <net/ethernet.h>
+#endif
#include "internal.h"
#include "domain_conf.h"
+/* XXX
+ * The config parser/structs should not be using platform specific
+ * constants. Win32 lacks these constants, breaking the parser,
+ * so temporarily define them until this can be re-written to use
+ * locally defined enums for all constants
+ */
+#ifndef ETHERTYPE_IP
+#define ETHERTYPE_IP 0x0800
+#endif
+#ifndef ETHERTYPE_ARP
+#define ETHERTYPE_ARP 0x0806
+#endif
+#ifndef ETHERTYPE_IPV6
+#define ETHERTYPE_IPV6 0x86dd
+#endif
+
#define VIR_FROM_THIS VIR_FROM_NWFILTER
#include <config.h>
#include <sys/types.h>
+#if HAVE_SYS_WAIT_H
#include <sys/wait.h>
+#endif
#include <sys/stat.h>
#include <unistd.h>
#include <stdlib.h>
* Returns: 0 if the execution succeeded, 1 if the script was not found or
* invalid parameters, and -1 if script returned an error
*/
+#ifdef WIN32
+int
+virHookCall(int driver ATTRIBUTE_UNUSED,
+ const char *id ATTRIBUTE_UNUSED,
+ int op ATTRIBUTE_UNUSED,
+ int sub_op ATTRIBUTE_UNUSED,
+ const char *extra ATTRIBUTE_UNUSED,
+ const char *input ATTRIBUTE_UNUSED) {
+ virReportSystemError(ENOSYS, "%s",
+ _("spawning hooks not supported on this platform"));
+ return -1;
+}
+#else
int
virHookCall(int driver, const char *id, int op, int sub_op, const char *extra,
const char *input) {
#undef ADD_ENV_LIT
#undef ADD_ENV_SPACE
}
+#endif
int virMutexInit(virMutexPtr m)
{
- virMutexInitRecursive(m);
+ return virMutexInitRecursive(m);
}
int virMutexInitRecursive(virMutexPtr m)
*/
static int disconnected = 0; /* we may have been disconnected */
+#ifdef SIGPIPE
/*
* vshCatchDisconnect:
*
sigaction(SIGPIPE, &sig_action, NULL);
}
+#else
+static void
+vshSetupSignals(void) {}
+#endif
/*
* vshReconnect:
&creation) < 0)
continue;
localtime_r(&creation, &time_info);
- strftime(timestr, sizeof(timestr), "%F %T %z", &time_info);
+ strftime(timestr, sizeof(timestr), "%Y-%m-%d %H:%M:%S %z", &time_info);
vshPrint(ctl, " %-20s %-25s %s\n", names[i], timestr, state);
}