* print.c (scm_print_options): Fixed texinfo in docstring.
authorMartin Grabmüller <mgrabmue@cs.tu-berlin.de>
Mon, 5 Mar 2001 07:25:56 +0000 (07:25 +0000)
committerMartin Grabmüller <mgrabmue@cs.tu-berlin.de>
Mon, 5 Mar 2001 07:25:56 +0000 (07:25 +0000)
* 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.

libguile/ChangeLog
libguile/net_db.c
libguile/print.c

index f6645b7..bd8b614 100644 (file)
@@ -1,3 +1,11 @@
+2001-03-05  Martin Grabmueller  <mgrabmue@cs.tu-berlin.de>
+
+       * 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.
+
 2001-03-04  Gary Houston  <ghouston@arglist.com>
 
        * socket.c (scm_fill_sockaddr): don't allow buffer overflows when
index 19a826d..408400f 100644 (file)
@@ -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);
     }
index 09f5c45..1e86d85 100644 (file)
@@ -136,8 +136,9 @@ scm_option scm_print_opts[] = {
 SCM_DEFINE (scm_print_options, "print-options-interface", 0, 1, 0, 
             (SCM setting),
            "Option interface for the print options. Instead of using\n"
-           "this procedure directly, use the procedures @code{print-enable},\n"
-           "@code{print-disable}, @code{print-set!} and @var{print-options}.")
+           "this procedure directly, use the procedures\n"
+           "@code{print-enable}, @code{print-disable}, @code{print-set!}\n"
+           "and @code{print-options}.")
 #define FUNC_NAME s_scm_print_options
 {
   SCM ans = scm_options (setting,