[PATCH v3 1/2] os: Introduce OsAbort for proper core dumps.

Rami Ylimaki ext-rami.ylimaki at nokia.com
Thu Jan 28 01:08:33 PST 2010


Signed-off-by: Rami Ylimaki <ext-rami.ylimaki at nokia.com>
---
 include/os.h |    2 ++
 os/utils.c   |   12 ++++++++++++
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/include/os.h b/include/os.h
index dad1af7..453ab82 100644
--- a/include/os.h
+++ b/include/os.h
@@ -262,6 +262,8 @@ extern _X_EXPORT void OsBlockSignals (void);
 
 extern _X_EXPORT void OsReleaseSignals (void);
 
+extern _X_EXPORT void OsAbort (void);
+
 #if !defined(WIN32)
 extern _X_EXPORT int System(char *);
 extern _X_EXPORT pointer Popen(char *, char *);
diff --git a/os/utils.c b/os/utils.c
index d7c8388..44c626f 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -1314,6 +1314,18 @@ OsReleaseSignals (void)
 #endif
 }
 
+/*
+ * Pending signals may interfere with core dumping. Provide a
+ * mechanism to block signals when aborting.
+ */
+
+void
+OsAbort (void)
+{
+    OsBlockSignals();
+    abort();
+}
+
 #if !defined(WIN32)
 /*
  * "safer" versions of system(3), popen(3) and pclose(3) which give up
-- 
1.6.0.4



More information about the xorg-devel mailing list