glom r1399 - in trunk: . glom/libglom



Author: arminb
Date: Mon Jan 28 11:55:57 2008
New Revision: 1399
URL: http://svn.gnome.org/viewvc/glom?rev=1399&view=rev

Log:
2008-01-28  Armin Burgmeier  <armin openismus com>

	* glom/libglom/spawn_with_feedback.cc: Set IOChannel that reads stderr
	from child process to be nonblocking to make sure we don't block the
	whole process.


Modified:
   trunk/ChangeLog
   trunk/glom/libglom/spawn_with_feedback.cc

Modified: trunk/glom/libglom/spawn_with_feedback.cc
==============================================================================
--- trunk/glom/libglom/spawn_with_feedback.cc	(original)
+++ trunk/glom/libglom/spawn_with_feedback.cc	Mon Jan 28 11:55:57 2008
@@ -379,24 +379,17 @@
 
   Glib::RefPtr<Glib::IOChannel> err = Glib::IOChannel::create_from_fd(child_stderr);
 
-  // Commented out, as it seems we do not get reading notifications on Windows
-  // with this:
-/*  // I think this can't actually fail, right after creation:
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
-  err->set_encoding("");
+  // We need to set the channel to nonblocking to not block the whole
+  // process waiting for input. This is not implemented on Windows, but
+  // it works there anyway; I guess it is always nonblocking on Windows:
 #ifndef G_OS_WIN32
-  // This is not implemented on Win32:
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
   err->set_flags(Glib::IO_FLAG_NONBLOCK);
-#endif
 #else
   std::auto_ptr<Glib::Error> error;
-#ifndef G_OS_WIN32
-  // This is not implemented on Win32:
   err->set_flags(Glib::IO_FLAG_NONBLOCK, error);
-#endif
-  err->set_encoding("", error);
-#endif
-  err->set_buffered(false);*/
+#endif // !GLIBMM_EXCEPTIONS_ENABLED
+#endif // !G_OS_WIN32
 
   sigc::connection stderr_conn = Glib::signal_io().connect(sigc::bind(sigc::ptr_fun(&on_stderr_input), err, sigc::ref(stderr_text)), err, Glib::IO_IN);
 



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