guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Boot-to-Guile!


From: Ludovic Courtès
Subject: Re: Boot-to-Guile!
Date: Sat, 16 Feb 2013 18:38:05 +0100
User-agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux)

Mike Gran <address@hidden> skribis:

> Here's a fun message specific to your hack.
>
>   scheme@(guile-user)> (getgroups)
>   ERROR: In procedure getgroups:
>   ERROR: In procedure getgroups: Success

Heh, funny.  :-)

Actually you found a bug, fixed like this:

diff --git a/libguile/posix.c b/libguile/posix.c
index 324f21b..52ade13 100644
--- a/libguile/posix.c
+++ b/libguile/posix.c
@@ -265,8 +265,10 @@ SCM_DEFINE (scm_getgroups, "getgroups", 0, 0, 0,
   GETGROUPS_T *groups;
 
   ngroups = getgroups (0, NULL);
-  if (ngroups <= 0)
+  if (ngroups < 0)
     SCM_SYSERROR;
+  else if (ngroups == 0)
+    return scm_c_make_vector (0, SCM_BOOL_F);
 
   size = ngroups * sizeof (GETGROUPS_T);
   groups = scm_malloc (size);
Thanks!

Ludo’.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]