summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Blandy <jimb@red-bean.com>1997-05-16 08:06:17 +0000
committerJim Blandy <jimb@red-bean.com>1997-05-16 08:06:17 +0000
commit3d781d4935e8eff2dbca3ba292b5f8667d7e4c31 (patch)
tree2deb79f991fef1aaf650b5f3af78507ef1f49f64
parent095936d24fe2aa23362faa15272e7f656cc7edcd (diff)
downloadguile-3d781d4935e8eff2dbca3ba292b5f8667d7e4c31.tar.gz
* net_db.c (scm_gethost, scm_getnet, scm_getproto, scm_getserv):
Return #f on end-of-file when scanning table (i.e. when called with no arguments). Try to catch errors, when we can. * posix.c (scm_getgrgid, scm_getpwuid): Same.
-rw-r--r--libguile/posix.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/libguile/posix.c b/libguile/posix.c
index 9a45ed91d..1379ef752 100644
--- a/libguile/posix.c
+++ b/libguile/posix.c
@@ -259,6 +259,11 @@ scm_getpwuid (user)
{
SCM_DEFER_INTS;
SCM_SYSCALL (entry = getpwent ());
+ if (! entry)
+ {
+ SCM_ALLOW_INTS;
+ return SCM_BOOL_F;
+ }
}
else if (SCM_INUMP (user))
{
@@ -324,7 +329,14 @@ scm_getgrgid (name)
ve = SCM_VELTS (result);
SCM_DEFER_INTS;
if (SCM_UNBNDP (name) || (name == SCM_BOOL_F))
- SCM_SYSCALL (entry = getgrent ());
+ {
+ SCM_SYSCALL (entry = getgrent ());
+ if (! entry)
+ {
+ SCM_ALLOW_INTS;
+ return SCM_BOOL_F;
+ }
+ }
else if (SCM_INUMP (name))
SCM_SYSCALL (entry = getgrgid (SCM_INUM (name)));
else