Fix Win32 portability problems

The network filter / snapshot / hooks code introduced some
non-portable pices that broke the win32 build

* configure.ac: Check for net/ethernet.h required by nwfile config
   parsing code
* src/conf/nwfilter_conf.c: Define ethernet protocol  constants
  if net/ethernet.h is missing
* src/util/hooks.c: Disable hooks build on Win32 since it lacks
  fork/exec/pipe
* src/util/threads-win32.c: Fix unchecked return value
* tools/virsh.c: Disable SIGPIPE on Win32 since it doesn't exist.
  Fix non-portable strftime() formats
This commit is contained in:
Daniel P. Berrange
2010-04-07 16:06:43 +01:00
parent 9fd54a78dc
commit 3d3af08879
5 changed files with 45 additions and 4 deletions

View File

@@ -414,6 +414,7 @@ out:
*/
static int disconnected = 0; /* we may have been disconnected */
#ifdef SIGPIPE
/*
* vshCatchDisconnect:
*
@@ -442,6 +443,10 @@ vshSetupSignals(void) {
sigaction(SIGPIPE, &sig_action, NULL);
}
#else
static void
vshSetupSignals(void) {}
#endif
/*
* vshReconnect:
@@ -8425,7 +8430,7 @@ cmdSnapshotList(vshControl *ctl, const vshCmd *cmd)
&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);
}