guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.11-22-gc497b


From: Ludovic Courtès
Subject: [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.11-22-gc497bfb
Date: Wed, 21 May 2014 13:34:40 +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=c497bfb1f6e58c118aa35087104ab821dca5030c

The branch, stable-2.0 has been updated
       via  c497bfb1f6e58c118aa35087104ab821dca5030c (commit)
       via  5e793ad8517d4036b115d2dbaaf105aad0414a20 (commit)
      from  4338f2f91e1dd63a40384077d091295d90047926 (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 c497bfb1f6e58c118aa35087104ab821dca5030c
Author: Ludovic Courtès <address@hidden>
Date:   Wed May 21 15:34:22 2014 +0200

    tests: Add test for _IOLBF.
    
    * test-suite/tests/ports.test ("pipe, fdopen, and _IOLBF"): New test.

commit 5e793ad8517d4036b115d2dbaaf105aad0414a20
Author: Ludovic Courtès <address@hidden>
Date:   Fri May 16 11:32:43 2014 +0200

    Silence GCC warning.
    
    * libguile/fports.c (scm_setvbuf): Initialize 'drained'.  GCC 4.9 raises
      a "may be used uninitialized warning" for 'drained', because it can't
      tell that 'drained' is initialized anytime NDRAINED > 0.

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

Summary of changes:
 libguile/fports.c           |    2 +-
 test-suite/tests/ports.test |   24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+), 1 deletions(-)

diff --git a/libguile/fports.c b/libguile/fports.c
index 5549bb1..29edc51 100644
--- a/libguile/fports.c
+++ b/libguile/fports.c
@@ -155,7 +155,7 @@ SCM_DEFINE (scm_setvbuf, "setvbuf", 2, 1, 0,
   int cmode;
   long csize;
   size_t ndrained;
-  char *drained;
+  char *drained = NULL;
   scm_t_port *pt;
   scm_t_port_internal *pti;
 
diff --git a/test-suite/tests/ports.test b/test-suite/tests/ports.test
index c1a185f..d87257e 100644
--- a/test-suite/tests/ports.test
+++ b/test-suite/tests/ports.test
@@ -623,6 +623,30 @@
             (equal? in-string "Mommy, why does everybody have a bomb?\n")))
   (delete-file filename))
 
+(pass-if-equal "pipe, fdopen, and _IOLBF"
+    "foo\nbar\n"
+  (let ((in+out (pipe))
+        (pid    (primitive-fork)))
+    (if (zero? pid)
+        (dynamic-wind
+          (const #t)
+          (lambda ()
+            (close-port (car in+out))
+            (let ((port (cdr in+out)))
+              (setvbuf port _IOLBF )
+              ;; Strings containing '\n' or should be flushed; others
+              ;; should be kept in PORT's buffer.
+              (display "foo\n" port)
+              (display "bar\n" port)
+              (display "this will be kept in PORT's buffer" port)))
+          (lambda ()
+            (primitive-_exit 0)))
+        (begin
+          (close-port (cdr in+out))
+          (let ((str (read-all (car in+out))))
+            (waitpid pid)
+            str)))))
+
 
 ;;;; Void ports.  These are so trivial we don't test them.
 


hooks/post-receive
-- 
GNU Guile



reply via email to

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