unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* EXIT_SUCCESS and EXIT_FAILURE in scheme land
@ 2014-09-06 16:16 Frank Terbeck
  2014-09-07 14:02 ` Frank Terbeck
  2014-09-22 20:53 ` Ludovic Courtès
  0 siblings, 2 replies; 3+ messages in thread
From: Frank Terbeck @ 2014-09-06 16:16 UTC (permalink / raw)
  To: guile-devel

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 <ft@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 <ft@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



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: EXIT_SUCCESS and EXIT_FAILURE in scheme land
  2014-09-06 16:16 EXIT_SUCCESS and EXIT_FAILURE in scheme land Frank Terbeck
@ 2014-09-07 14:02 ` Frank Terbeck
  2014-09-22 20:53 ` Ludovic Courtès
  1 sibling, 0 replies; 3+ messages in thread
From: Frank Terbeck @ 2014-09-07 14:02 UTC (permalink / raw)
  To: guile-devel

Frank Terbeck wrote:
> I personally don't know any OS that doesn't use EXIT_SUCCESS := 1, but

Err... EXIT_SUCCESS := 0, was what I meant, of course. :)



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: EXIT_SUCCESS and EXIT_FAILURE in scheme land
  2014-09-06 16:16 EXIT_SUCCESS and EXIT_FAILURE in scheme land Frank Terbeck
  2014-09-07 14:02 ` Frank Terbeck
@ 2014-09-22 20:53 ` Ludovic Courtès
  1 sibling, 0 replies; 3+ messages in thread
From: Ludovic Courtès @ 2014-09-22 20:53 UTC (permalink / raw)
  To: Frank Terbeck; +Cc: guile-devel

Frank Terbeck <ft@bewatermyfriend.org> skribis:

> 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?

Yes (esp. since the GNU Coding Standards suggest using them.)
Pushed as 447af51.

Thanks,
Ludo’.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-09-22 20:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-06 16:16 EXIT_SUCCESS and EXIT_FAILURE in scheme land Frank Terbeck
2014-09-07 14:02 ` Frank Terbeck
2014-09-22 20:53 ` Ludovic Courtès

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).