SF.net SVN: geany: [1353] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Thu Mar 1 21:45:43 UTC 2007


Revision: 1353
          http://svn.sourceforge.net/geany/?rev=1353&view=rev
Author:   eht16
Date:     2007-03-01 13:45:43 -0800 (Thu, 01 Mar 2007)

Log Message:
-----------
Set IO channels for custom commands to blocking mode (thanks to Jeff Pohlmeyer).

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/build.c
    trunk/src/tools.c
    trunk/src/utils.c
    trunk/src/utils.h

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2007-03-01 17:36:51 UTC (rev 1352)
+++ trunk/ChangeLog	2007-03-01 21:45:43 UTC (rev 1353)
@@ -15,6 +15,9 @@
    sci_get_pos_at_line_sel_start(), sci_get_pos_at_line_sel_end().
  * src/document.c:
    Improved replacing in rectangle selections (closes #1665571).
+ * src/build.c, src/tools.c, src/utils.c, src/utils.h:
+   Set IO channels for custom commands to blocking mode
+   (thanks to Jeff Pohlmeyer).
    
 
 2007-02-28  Nick Treleaven  <nick.treleaven at btinternet.com>

Modified: trunk/src/build.c
===================================================================
--- trunk/src/build.c	2007-03-01 17:36:51 UTC (rev 1352)
+++ trunk/src/build.c	2007-03-01 21:45:43 UTC (rev 1353)
@@ -483,9 +483,9 @@
 
 	// use GIOChannels to monitor stdout and stderr
 	utils_set_up_io_channel(stdout_fd, G_IO_IN|G_IO_PRI|G_IO_ERR|G_IO_HUP|G_IO_NVAL,
-		build_iofunc, GINT_TO_POINTER(0));
+		TRUE, build_iofunc, GINT_TO_POINTER(0));
 	utils_set_up_io_channel(stderr_fd, G_IO_IN|G_IO_PRI|G_IO_ERR|G_IO_HUP|G_IO_NVAL,
-		build_iofunc, GINT_TO_POINTER(1));
+		TRUE, build_iofunc, GINT_TO_POINTER(1));
 
 	g_strfreev(argv);
 	g_free(working_dir);

Modified: trunk/src/tools.c
===================================================================
--- trunk/src/tools.c	2007-03-01 17:36:51 UTC (rev 1352)
+++ trunk/src/tools.c	2007-03-01 21:45:43 UTC (rev 1353)
@@ -616,10 +616,10 @@
 
 		// use GIOChannel to monitor stdout
 		utils_set_up_io_channel(stdout_fd, G_IO_IN|G_IO_PRI|G_IO_ERR|G_IO_HUP|G_IO_NVAL,
-				cc_iofunc, GINT_TO_POINTER(idx));
+				FALSE, cc_iofunc, GINT_TO_POINTER(idx));
 		// copy program's stderr to Geany's stdout to help error tracking
 		utils_set_up_io_channel(stderr_fd, G_IO_IN|G_IO_PRI|G_IO_ERR|G_IO_HUP|G_IO_NVAL,
-				cc_iofunc_err, (gpointer)command);
+				FALSE, cc_iofunc_err, (gpointer)command);
 
 		// get selection
 		len = sci_get_selected_text_length(doc_list[idx].sci);

Modified: trunk/src/utils.c
===================================================================
--- trunk/src/utils.c	2007-03-01 17:36:51 UTC (rev 1352)
+++ trunk/src/utils.c	2007-03-01 21:45:43 UTC (rev 1353)
@@ -1208,14 +1208,17 @@
 }
 
 
-GIOChannel *utils_set_up_io_channel(gint fd, GIOCondition cond, GIOFunc func, gpointer data)
+GIOChannel *utils_set_up_io_channel(
+				gint fd, GIOCondition cond, gboolean nblock, GIOFunc func, gpointer data)
 {
 	GIOChannel *ioc;
 	//const gchar *encoding;
 
 	ioc = g_io_channel_unix_new(fd);
 
-	g_io_channel_set_flags(ioc, G_IO_FLAG_NONBLOCK, NULL);
+	if (nblock)
+		g_io_channel_set_flags(ioc, G_IO_FLAG_NONBLOCK, NULL);
+	
 	g_io_channel_set_encoding(ioc, NULL, NULL);
 /*
 	if (! g_get_charset(&encoding))

Modified: trunk/src/utils.h
===================================================================
--- trunk/src/utils.h	2007-03-01 17:36:51 UTC (rev 1352)
+++ trunk/src/utils.h	2007-03-01 21:45:43 UTC (rev 1353)
@@ -126,7 +126,8 @@
 // returned string must be freed.
 gchar *utils_get_current_time_string();
 
-GIOChannel *utils_set_up_io_channel(gint fd, GIOCondition cond, GIOFunc func, gpointer data);
+GIOChannel *utils_set_up_io_channel(gint fd, GIOCondition cond, gboolean nblock,
+									GIOFunc func, gpointer data);
 
 gchar **utils_read_file_in_array(const gchar *filename);
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list