guile-cvs
[Top][All Lists]
Advanced

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

guile/guile-core/libguile ChangeLog fports.c th...


From: Gary Houston
Subject: guile/guile-core/libguile ChangeLog fports.c th...
Date: Mon, 13 Nov 2000 15:16:39 -0800

CVSROOT:        /cvs
Module name:    guile
Changes by:     Gary Houston <address@hidden>   00/11/13 15:16:38

Modified files:
        guile-core/libguile: ChangeLog fports.c throw.c 

Log message:
        * fports.c: include gc.h.
        (fport_flush, fport_close): silently ignore I/O errors when
        closing a port during gc.  it's better than aborting in scm_error.
        
        * throw.c (scm_handle_by_message): remove obsolete comment.

CVSWeb URLs:
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/ChangeLog.diff?r1=1.1165&r2=1.1166
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/fports.c.diff?r1=1.83&r2=1.84
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/throw.c.diff?r1=1.70&r2=1.71

Patches:
Index: guile/guile-core/libguile/ChangeLog
diff -u guile/guile-core/libguile/ChangeLog:1.1165 
guile/guile-core/libguile/ChangeLog:1.1166
--- guile/guile-core/libguile/ChangeLog:1.1165  Sun Nov 12 04:20:52 2000
+++ guile/guile-core/libguile/ChangeLog Mon Nov 13 15:16:38 2000
@@ -1,3 +1,11 @@
+2000-11-13  Gary Houston  <address@hidden>
+
+       * fports.c: include gc.h.
+       (fport_flush, fport_close): silently ignore I/O errors when
+       closing a port during gc.  it's better than aborting in scm_error.
+
+       * throw.c (scm_handle_by_message): remove obsolete comment.
+
 2000-11-12  Gary Houston  <address@hidden>
 
        * fports.c (scm_open_file): fix the 'b' option.  Thanks
Index: guile/guile-core/libguile/fports.c
diff -u guile/guile-core/libguile/fports.c:1.83 
guile/guile-core/libguile/fports.c:1.84
--- guile/guile-core/libguile/fports.c:1.83     Sun Nov 12 04:20:52 2000
+++ guile/guile-core/libguile/fports.c  Mon Nov 13 15:16:38 2000
@@ -48,8 +48,9 @@
 #include <fcntl.h>
 #include "libguile/_scm.h"
 #include "libguile/strings.h"
-
 #include "libguile/validate.h"
+#include "libguile/gc.h"
+
 #include "libguile/fports.h"
 
 #ifdef HAVE_STRING_H
@@ -643,9 +644,7 @@
                }
              pt->write_pos = pt->write_buf + remaining;
            }
-         if (!terminating)
-           scm_syserror ("fport_flush");
-         else
+         if (terminating)
            {
              const char *msg = "Error: could not flush file-descriptor ";
              char buf[11];
@@ -656,6 +655,14 @@
 
              count = remaining;
            }
+         else if (scm_gc_running_p)
+           {
+             /* silently ignore the error.  scm_error would abort if we
+                called it now.  */
+             count = remaining;
+           }
+         else
+           scm_syserror ("fport_flush");
        }
       ptr += count;
       remaining -= count;
@@ -694,7 +701,14 @@
   fport_flush (port);
   SCM_SYSCALL (rv = close (fp->fdes));
   if (rv == -1 && errno != EBADF)
-    scm_syserror ("fport_close");
+    {
+      if (scm_gc_running_p)
+       /* silently ignore the error.  scm_error would abort if we
+          called it now.  */
+       ;
+      else
+       scm_syserror ("fport_close");
+    }
   if (pt->read_buf == pt->putback_buf)
     pt->read_buf = pt->saved_read_buf;
   if (pt->read_buf != &pt->shortbuf)
Index: guile/guile-core/libguile/throw.c
diff -u guile/guile-core/libguile/throw.c:1.70 
guile/guile-core/libguile/throw.c:1.71
--- guile/guile-core/libguile/throw.c:1.70      Tue Sep 19 03:56:57 2000
+++ guile/guile-core/libguile/throw.c   Mon Nov 13 15:16:38 2000
@@ -485,9 +485,6 @@
     }
 
   handler_message (handler_data, tag, args);
-  /* try to flush the error message first before the rest of the
-     ports: if any throw error, it currently causes a bus
-     exception.  */
   exit (2);
 }
 



reply via email to

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