Hello guile developers,

I personally don't know any OS that doesn't use EXIT_SUCCESS := 1, but
nevertheless I think it's useful to have EXIT_SUCCESS and _FAILURE
available in scheme land. They are from stdlib.h, so I suppose adding
them to ‘libguile/posix.c’ makes sense. The patch below seems to do the
trick for me.

Would something like this be welcome?

Regards, Frank


>From 9d9a4f0f4e5789950b7007c08b15c06b79dd332c Mon Sep 17 00:00:00 2001
From: Frank Terbeck <f...@bewatermyfriend.org>
Date: Fri, 5 Sep 2014 00:31:04 +0200
Subject: [PATCH] Make EXIT_SUCCESS and _FAILURE available in scheme land

Signed-off-by: Frank Terbeck <f...@bewatermyfriend.org>
---
 libguile/posix.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libguile/posix.c b/libguile/posix.c
index 7fc6903..2654716 100644
--- a/libguile/posix.c
+++ b/libguile/posix.c
@@ -2247,6 +2247,12 @@ void
 scm_init_posix ()
 {
   scm_add_feature ("posix");
+#ifdef EXIT_SUCCESS
+  scm_c_define ("EXIT_SUCCESS", scm_from_int (EXIT_SUCCESS));
+#endif
+#ifdef EXIT_FAILURE
+  scm_c_define ("EXIT_FAILURE", scm_from_int (EXIT_FAILURE));
+#endif
 #ifdef HAVE_GETEUID
   scm_add_feature ("EIDs");
 #endif
-- 
2.1.0.60.g85f0837

Reply via email to