Update of /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml-player
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9862/mozilla-plugin/src/openvrml-player
Modified Files:
command_istream.cpp
Log Message:
Use g_io_channel_get_buffer_condition instead of select/FD_ISSET.
Index: command_istream.cpp
===================================================================
RCS file: /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml-player/command_istream.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** command_istream.cpp 22 Jan 2006 07:14:02 -0000 1.2
--- command_istream.cpp 29 Jan 2006 07:00:59 -0000 1.3
***************
*** 53,58 ****
*static_cast<command_streambuf *>(data);
- const int fd = g_io_channel_unix_get_fd(source);
- fd_set readfds;
do {
gchar c;
--- 53,56 ----
***************
*** 79,96 ****
streambuf.source_buffer_.put(traits_type::to_int_type(c));
! FD_ZERO(&readfds);
! FD_SET(fd, &readfds);
!
! fd_set errorfds;
! FD_ZERO(&errorfds);
! FD_SET(fd, &errorfds);
!
! timeval timeout = { 0, 0 };
! int bits_set = select(fd + 1, &readfds, 0, &errorfds, &timeout);
! if (FD_ISSET(fd, &errorfds) || bits_set < 0) {
! g_warning(strerror(errno));
! g_return_val_if_reached(false);
! }
! } while (FD_ISSET(fd, &readfds));
return true;
--- 77,81 ----
streambuf.source_buffer_.put(traits_type::to_int_type(c));
! } while (g_io_channel_get_buffer_condition(source) & G_IO_IN);
return true;
|