bug-gnu-pspp
[Top][All Lists]
Advanced

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

PSPP-BUG: [bug #17213] interactive output should go to terminal


From: Ben Pfaff
Subject: PSPP-BUG: [bug #17213] interactive output should go to terminal
Date: Fri, 27 Jul 2007 23:00:05 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.1) Gecko/20061205 Iceweasel/2.0.0.1 (Debian-2.0.0.1+dfsg-1)

Update of bug #17213 (project pspp):

                  Status:   Ready for Test/Review => Fixed                  
             Open/Closed:                    Open => Closed                 

    _______________________________________________________

Follow-up Comment #3:

>Maybe it's possible for two distinct pointers to be associated
>with the same stdio stream, or perhaps it could fail after a call
>to freopen ?? I don't know. 

My goal here is that if you use fn_open("-", <mode>) and thereby get a
standard stream out of it, then fn_close("-", <stream>) won't close that
standard stream.  What you're saying can't happen in ISO C, which doesn't
allow the standard streams to be assigned to, and freopen always returns the
same FILE * that it is passed.  In the GNU C library, you can actually assign
new streams to stdin/out/err, so the problem could arise, but it's a bad idea
to assign to them and PSPP (and gnulib) doesn't do that.

I considered using dup and fdopen to actually duplicate the standard streams
instead of just trying to detect them.  But that's troublesome for another
reason: we'd have to be pretty careful about calling fflush in the right
places to avoid interleaving output strangely.

>Perhaps it would be better to use 
> if ( fileno(f) == STDIN_FILENO || ... 

I don't know why I bothered to write all the text above.  I think your
solution is fine.  I'll do that.

>2. I'll assume that the HAVE_LIBTERMCAP vs. HAVE_LIBNCURSES 
>change is correct. 

I think it is: that code didn't do anything before and now it appears to work
in testing.

Thanks!  I checked this in.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?17213>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

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