GNU bug report logs - #10616
flush procedure for soft ports isn't called

Previous Next

Package: guile;

Reported by: Ian Price <ianprice90 <at> googlemail.com>

Date: Thu, 26 Jan 2012 22:19:01 UTC

Severity: normal

Done: Mark H Weaver <mhw <at> netris.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Ian Price <ianprice90 <at> googlemail.com>
Subject: bug#10616: closed (Re: bug#10616: flush procedure for soft ports
 isn't called)
Date: Thu, 08 Mar 2012 05:11:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#10616: flush procedure for soft ports isn't called

which was filed against the guile package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 10616 <at> debbugs.gnu.org.

-- 
10616: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10616
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Mark H Weaver <mhw <at> netris.org>
To: Ian Price <ianprice90 <at> googlemail.com>
Cc: 10616-done <at> debbugs.gnu.org
Subject: Re: bug#10616: flush procedure for soft ports isn't called
Date: Thu, 08 Mar 2012 00:06:38 -0500
Hi Ian,

Ian Price <ianprice90 <at> googlemail.com> writes:
> From 8a9524014ce85fb34fe5cfd7a2667395ce0cdf5d Mon Sep 17 00:00:00 2001
> From: Ian Price <ianprice90 <at> googlemail.com>
> Date: Fri, 27 Jan 2012 06:38:09 +0000
> Subject: [PATCH] Fix flush on soft ports, so that it actually runs.
>
> * libguile/vports.c (sf_flush): Remove conditional testing the
>   position in the port's write_buf, as it is no longer used.
> ---
>  libguile/vports.c |   18 ++++--------------
>  1 files changed, 4 insertions(+), 14 deletions(-)
>
> diff --git a/libguile/vports.c b/libguile/vports.c
> index 5178d79..75e7df3 100644
> --- a/libguile/vports.c
> +++ b/libguile/vports.c
> @@ -56,21 +56,11 @@ sf_flush (SCM port)
>    scm_t_port *pt = SCM_PTAB_ENTRY (port);
>    SCM stream = SCM_PACK (pt->stream);
>  
> -  if (pt->write_pos > pt->write_buf)
> -    {
> -      /* write the byte. */
> -      scm_call_1 (SCM_SIMPLE_VECTOR_REF (stream, 0),
> -		  SCM_MAKE_CHAR (*pt->write_buf));
> -      pt->write_pos = pt->write_buf;
> -  
> -      /* flush the output.  */
> -      {
> -	SCM f = SCM_SIMPLE_VECTOR_REF (stream, 2);
> +  SCM f = SCM_SIMPLE_VECTOR_REF (stream, 2);
> +
> +  if (scm_is_true (f))
> +    scm_call_0 (f);
>  
> -	if (scm_is_true (f))
> -	  scm_call_0 (f);
> -      }
> -    }
>  }
>  
>  static void

Applied, thanks!

     Mark

[Message part 3 (message/rfc822, inline)]
From: Ian Price <ianprice90 <at> googlemail.com>
To: bug-guile <bug-guile <at> gnu.org>
Subject: flush procedure for soft ports isn't called
Date: Thu, 26 Jan 2012 22:10:37 +0000
Hi guilers,

I've noticed when trying to use soft ports that the 3rd procedure in the
vector doesn't get called when I use `force-output'. The simplest
example follows

scheme@(guile−user)> (let* ((port (make-soft-port
                                   (vector #f #f (lambda () 'flushed) #f #f)
                                   "rw")))
                       (force-output port))
scheme@(guile−user)> 

I have no issues with the other procedures. This is on current stable,
on 32 bit x86 running Fedora 16. More complicated examples available on
request.

-- 
Ian Price

"Programming is like pinball. The reward for doing it well is
the opportunity to do it again" - from "The Wizardy Compiled"



This bug report was last modified 13 years and 131 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.