[libvirt] [PATCH 07/15] virsh: Handle absence of SA_SIGINFO

Matthias Bolte matthias.bolte at googlemail.com
Mon Mar 22 01:25:37 UTC 2010


MinGW and gnulib don't provide SA_SIGINFO on Windows.
---
 tools/virsh.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/tools/virsh.c b/tools/virsh.c
index 32895b2..1c932bd 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -411,11 +411,13 @@ static int disconnected = 0; /* we may have been disconnected */
  * We get here when a SIGPIPE is being raised, we can't do much in the
  * handler, just save the fact it was raised
  */
+#ifdef SA_SIGINFO
 static void vshCatchDisconnect(int sig, siginfo_t * siginfo,
                                void* context ATTRIBUTE_UNUSED) {
     if ((sig == SIGPIPE) || (siginfo->si_signo == SIGPIPE))
         disconnected++;
 }
+#endif
 
 /*
  * vshSetupSignals:
@@ -425,6 +427,7 @@ static void vshCatchDisconnect(int sig, siginfo_t * siginfo,
  */
 static void
 vshSetupSignals(void) {
+#ifdef SA_SIGINFO
     struct sigaction sig_action;
 
     sig_action.sa_sigaction = vshCatchDisconnect;
@@ -432,6 +435,7 @@ vshSetupSignals(void) {
     sigemptyset(&sig_action.sa_mask);
 
     sigaction(SIGPIPE, &sig_action, NULL);
+#endif
 }
 
 /*
-- 
1.6.3.3




More information about the libvir-list mailing list