guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] GNU Guile branch, master, updated. release_1-9-11-300-g5


From: Ludovic Courtès
Subject: [Guile-commits] GNU Guile branch, master, updated. release_1-9-11-300-g5335850
Date: Wed, 01 Sep 2010 13:08:51 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=5335850dbf9f11e9bbef0c8f88f12b684885db19

The branch, master has been updated
       via  5335850dbf9f11e9bbef0c8f88f12b684885db19 (commit)
       via  72a54e94807720c601efdef532da5dbea4abc23a (commit)
       via  25ccb5a5ab74db631d86471d196c22c24277eef2 (commit)
      from  54d9a994b1b71024aad3d1f586de7a81bb873dbf (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 5335850dbf9f11e9bbef0c8f88f12b684885db19
Author: Ludovic Courtès <address@hidden>
Date:   Wed Sep 1 15:04:59 2010 +0200

    Rewrite `fport_flush' using Gnulib's `full_write'.
    
    * libguile/fports.c (fport_flush): Rewrite using `full_write'.

commit 72a54e94807720c601efdef532da5dbea4abc23a
Author: Ludovic Courtès <address@hidden>
Date:   Wed Sep 1 15:03:24 2010 +0200

    popen.test: Don't auto-compile `popen-child.scm'.
    
    * test-suite/tests/popen.test ("open-output-pipe")["no duplicate"]:
      Disable auto-compilation of `popen-child.scm'.

commit 25ccb5a5ab74db631d86471d196c22c24277eef2
Author: Ludovic Courtès <address@hidden>
Date:   Wed Sep 1 14:52:36 2010 +0200

    Add `test-suite/tests/popen-child.scm' to the distribution.
    
    * test-suite/Makefile.am (SCM_TESTS): Add `tests/popen-child.scm'.

-----------------------------------------------------------------------

Summary of changes:
 libguile/fports.c           |   42 +++++++-----------------------------------
 test-suite/Makefile.am      |    1 +
 test-suite/tests/popen.test |    9 +++++----
 3 files changed, 13 insertions(+), 39 deletions(-)

diff --git a/libguile/fports.c b/libguile/fports.c
index 4a24dc6..fd8faf8 100644
--- a/libguile/fports.c
+++ b/libguile/fports.c
@@ -52,6 +52,8 @@
 #include <errno.h>
 #include <sys/types.h>
 
+#include <full-write.h>
+
 #include "libguile/iselect.h"
 
 /* Some defines for Windows (native port, not Cygwin). */
@@ -823,45 +825,15 @@ fport_write (SCM port, const void *data, size_t size)
 static void
 fport_flush (SCM port)
 {
+  size_t written;
   scm_t_port *pt = SCM_PTAB_ENTRY (port);
   scm_t_fport *fp = SCM_FSTREAM (port);
-  unsigned char *ptr = pt->write_buf;
-  long init_size = pt->write_pos - pt->write_buf;
-  long remaining = init_size;
-
-  while (remaining > 0)
-    {
-      long count;
+  size_t count = pt->write_pos - pt->write_buf;
 
-      SCM_SYSCALL (count = write (fp->fdes, ptr, remaining));
-      if (count < 0)
-       {
-         /* error.  assume nothing was written this call, but
-            fix up the buffer for any previous successful writes.  */
-         long done = init_size - remaining;
-             
-         if (done > 0)
-           {
-             int i;
+  written = full_write (fp->fdes, pt->write_buf, count);
+  if (written < count)
+    scm_syserror ("scm_flush");
 
-             for (i = 0; i < remaining; i++)
-               {
-                 *(pt->write_buf + i) = *(pt->write_buf + done + i);
-               }
-             pt->write_pos = pt->write_buf + remaining;
-           }
-         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;
-    }
   pt->write_pos = pt->write_buf;
   pt->rw_active = SCM_PORT_NEITHER;
 }
diff --git a/test-suite/Makefile.am b/test-suite/Makefile.am
index eaa7512..6926149 100644
--- a/test-suite/Makefile.am
+++ b/test-suite/Makefile.am
@@ -73,6 +73,7 @@ SCM_TESTS = tests/00-initial-env.test         \
            tests/procprop.test                 \
            tests/poe.test                      \
            tests/popen.test                    \
+           tests/popen-child.scm               \
            tests/ports.test                    \
            tests/posix.test                    \
            tests/q.test                        \
diff --git a/test-suite/tests/popen.test b/test-suite/tests/popen.test
index a408c9e..5a92d60 100644
--- a/test-suite/tests/popen.test
+++ b/test-suite/tests/popen.test
@@ -1,6 +1,6 @@
 ;;;; popen.test --- exercise ice-9/popen.scm      -*- scheme -*-
 ;;;;
-;;;; Copyright 2003, 2006 Free Software Foundation, Inc.
+;;;; Copyright 2003, 2006, 2010 Free Software Foundation, Inc.
 ;;;;
 ;;;; This library is free software; you can redistribute it and/or
 ;;;; modify it under the terms of the GNU Lesser General Public
@@ -167,9 +167,10 @@
     (let* ((c2p (pipe))
           (port (with-error-to-port (cdr c2p)
                   (lambda ()
-                    (open-output-pipe (format #f
-                                               "guile -s 
~a/tests/popen-child.scm"
-                                               (getenv "TEST_SUITE_DIR")))))))
+                    (open-output-pipe
+                      (string-append "guile --no-autocompile -s \""
+                                     (getenv "TEST_SUITE_DIR")
+                                     "/tests/popen-child.scm\""))))))
       (close-port (cdr c2p))   ;; write side
       (with-epipe
        (lambda ()


hooks/post-receive
-- 
GNU Guile



reply via email to

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