26ba25
From cf155192becebab6187749a4df4b8e33e5fc1e68 Mon Sep 17 00:00:00 2001
26ba25
From: "plai@redhat.com" <plai@redhat.com>
26ba25
Date: Thu, 21 Jun 2018 18:54:39 +0200
26ba25
Subject: [PATCH 160/268] osdep: add wait.h compat macros
26ba25
26ba25
RH-Author: plai@redhat.com
26ba25
Message-id: <1529607285-9942-5-git-send-email-plai@redhat.com>
26ba25
Patchwork-id: 80938
26ba25
O-Subject: [RHEL7.6 PATCH BZ 1526645 04/10] osdep: add wait.h compat macros
26ba25
Bugzilla: 1526645
26ba25
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
26ba25
RH-Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
26ba25
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
26ba25
26ba25
From: "Michael S. Tsirkin" <mst@redhat.com>
26ba25
26ba25
Man page for WCOREDUMP says:
26ba25
26ba25
  WCOREDUMP(wstatus) returns true if the child produced a core dump.
26ba25
  This macro should be employed only if WIFSIGNALED returned true.
26ba25
26ba25
  This  macro  is  not  specified  in POSIX.1-2001 and is not
26ba25
  available on some UNIX implementations (e.g., AIX, SunOS).  Therefore,
26ba25
  enclose its use inside #ifdef WCOREDUMP ... #endif.
26ba25
26ba25
Let's do exactly this.
26ba25
26ba25
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
26ba25
(cherry picked from commit 28012e190e6897cfc2a98364240909d08e90ffc0)
26ba25
Signed-off-by: Paul Lai <plai@redhat.com>
26ba25
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
26ba25
---
26ba25
 include/qemu/osdep.h | 10 ++++++++++
26ba25
 1 file changed, 10 insertions(+)
26ba25
26ba25
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
26ba25
index 5910682..9ed6242 100644
26ba25
--- a/include/qemu/osdep.h
26ba25
+++ b/include/qemu/osdep.h
26ba25
@@ -108,6 +108,16 @@ extern int daemon(int, int);
26ba25
 #include "qemu/typedefs.h"
26ba25
 
26ba25
 /*
26ba25
+ * According to waitpid man page:
26ba25
+ * WCOREDUMP
26ba25
+ *  This  macro  is  not  specified  in POSIX.1-2001 and is not
26ba25
+ *  available on some UNIX implementations (e.g., AIX, SunOS).
26ba25
+ *  Therefore, enclose its use inside #ifdef WCOREDUMP ... #endif.
26ba25
+ */
26ba25
+#ifndef WCOREDUMP
26ba25
+#define WCOREDUMP(status) 0
26ba25
+#endif
26ba25
+/*
26ba25
  * We have a lot of unaudited code that may fail in strange ways, or
26ba25
  * even be a security risk during migration, if you disable assertions
26ba25
  * at compile-time.  You may comment out these safety checks if you
26ba25
-- 
26ba25
1.8.3.1
26ba25