summaryrefslogtreecommitdiff
path: root/libguile/net_db.c
diff options
context:
space:
mode:
authorMartin Grabmüller <mgrabmue@cs.tu-berlin.de>2001-03-05 07:25:56 +0000
committerMartin Grabmüller <mgrabmue@cs.tu-berlin.de>2001-03-05 07:25:56 +0000
commit1dd05fd8aa1044dca6df3de7026a49f79246a5dc (patch)
tree03029063f968078b55d5d9359b3680970b15f2aa /libguile/net_db.c
parent2772dc1af32683c7821ff2b20ec5f00e92890fe0 (diff)
downloadguile-1dd05fd8aa1044dca6df3de7026a49f79246a5dc.tar.gz
* print.c (scm_print_options): Fixed texinfo in docstring.
* net_db.c (scm_getserv, scm_getproto, scm_getnet): Return #f if the underlying functions getservent, getprotoent or getnetent return NULL instead of signalling an error.
Diffstat (limited to 'libguile/net_db.c')
-rw-r--r--libguile/net_db.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/libguile/net_db.c b/libguile/net_db.c
index 19a826d09..408400f58 100644
--- a/libguile/net_db.c
+++ b/libguile/net_db.c
@@ -340,14 +340,13 @@ SCM_DEFINE (scm_getnet, "getnet", 0, 1, 0,
ve = SCM_VELTS (ans);
if (SCM_UNBNDP (net))
{
- errno = 0;
entry = getnetent ();
if (! entry)
{
- if (errno)
- SCM_SYSERROR;
- else
- return SCM_BOOL_F;
+ /* There's no good way to tell whether zero means an error
+ or end-of-file, so we always return #f. See `gethost'
+ for details. */
+ return SCM_BOOL_F;
}
}
else if (SCM_STRINGP (net))
@@ -392,14 +391,13 @@ SCM_DEFINE (scm_getproto, "getproto", 0, 1, 0,
ve = SCM_VELTS (ans);
if (SCM_UNBNDP (protocol))
{
- errno = 0;
entry = getprotoent ();
if (! entry)
{
- if (errno)
- SCM_SYSERROR;
- else
- return SCM_BOOL_F;
+ /* There's no good way to tell whether zero means an error
+ or end-of-file, so we always return #f. See `gethost'
+ for details. */
+ return SCM_BOOL_F;
}
}
else if (SCM_STRINGP (protocol))
@@ -456,14 +454,13 @@ SCM_DEFINE (scm_getserv, "getserv", 0, 2, 0,
struct servent *entry;
if (SCM_UNBNDP (name))
{
- errno = 0;
entry = getservent ();
if (!entry)
{
- if (errno)
- SCM_SYSERROR;
- else
- return SCM_BOOL_F;
+ /* There's no good way to tell whether zero means an error
+ or end-of-file, so we always return #f. See `gethost'
+ for details. */
+ return SCM_BOOL_F;
}
return scm_return_entry (entry);
}