gdk_input problem



Hi!

I've got a problem with the input facility in gdk/gtk.

According to http://developer.gnome.org/doc/API/gdk/gdk-input.html:
"GDK_INPUT_READ   the file descriptor has become available for reading.
                  (Or, as is standard in Unix, a socket or pipe was 
                  closed at the other end; this is the case if a 
                  subsequent read on the file descriptor returns a 
                  count of zero.)"

But that's not what really happens. The GdkInputFunction will never be
called unless there's something avalilable for reading. (Ie it won't get
called if the other end of a pipe got closed.)

I've attached a small(ish) testcase. Untar, run the build-script, and
then run "case". 

(It's getting late, and I couldn't be bothered to write a make file for
this.) 

The output I get is:

hardin(194)> ./case 
got data from fd 7, "a", result 1
got data from fd 7, "p", result 1
got data from fd 7, "a", result 1
(it never exits, but that's OK.)

The program on the other end dies after printfing "apa" so the pipe
definetly gets closed. I should be called one more time and get a result
(count) of 0 here, shouldn't I?  Or am I missing someting major here?

(And I never get anything at all from the other pipe, where the process
just dies.)

This might be platform-specific, I'm not sure.  This happens on (at
least) Solaris 8 with gtk versions 1.2.6 and 1.2.9.

/August.
-- 
Wrong on most accounts.  const Foo *foo; and Foo const *foo; mean the same: foo
being a pointer to const Foo.  const Foo const *foo; would mean the same but is
illegal (double const).  You are confusing this with Foo * const foo; and const
Foo * const foo; respectively. -David Kastrup, comp.os.linux.development.system

Attachment: bug.tar.gz
Description: application/tar-gz



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