7134751 xconsole failing with couldn't open console on Netra T3-2 and T5220
authorArvind Umrao <Arvind.Umrao@Sun.COM>
Thu, 23 Feb 2012 02:02:49 -0800
changeset 1245 9a76fccb9dca
parent 1244 94b8d1e21e14
child 1246 28f77fd3f982
7134751 xconsole failing with couldn't open console on Netra T3-2 and T5220
open-src/app/xconsole/7134751.patch
open-src/app/xconsole/Makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/app/xconsole/7134751.patch	Thu Feb 23 02:02:49 2012 -0800
@@ -0,0 +1,30 @@
+From 7f9415e399b306b648235bde11c68cd00a5b17cc Mon Sep 17 00:00:00 2001
+From: Arvind Umrao <[email protected]>
+Date: Mon, 20 Feb 2012 02:12:32 -0800
+Subject: [PATCH] Open file in non blocking mode
+Sometime special files like fifo need to open in nonblocking mode
+otherwise whole xconsole GUI freezes.
+
+---
+ xconsole.c |    5 ++++-
+ 1 files changed, 4 insertions(+), 1 deletions(-)
+
+diff --git a/xconsole.c b/xconsole.c
+index d8656e8..b74cc3b 100644
+--- a/xconsole.c
++++ b/xconsole.c
+@@ -334,7 +334,10 @@ OpenConsole(void)
+ 	    regularFile = FALSE;
+ 	    if (access(app_resources.file, R_OK) == 0)
+ 	    {
+-		input = fopen (app_resources.file, "r");
++		int fd  = open (app_resources.file, O_RDONLY | O_NONBLOCK | O_NOCTTY);
++ 		if (fd != -1)
++		    input = fdopen (fd, "r");
++
+ 		if (input)
+ 		    if (!stat(app_resources.file, &sbuf) &&
+ 			S_ISREG( sbuf.st_mode ) )
+-- 
+1.7.3.2
+
--- a/open-src/app/xconsole/Makefile	Mon Feb 20 11:30:42 2012 -0800
+++ b/open-src/app/xconsole/Makefile	Thu Feb 23 02:02:49 2012 -0800
@@ -36,7 +36,7 @@
 TARBALL_SHA1 = 195299d4948ba4c62e961ddd0bd4572283244715
 
 # Patches to apply to source after unpacking, in order
-SOURCE_PATCHES = 
+SOURCE_PATCHES = 7134751.patch,-p1
 
 # Package classification (override default)
 MODULE_PKGCLASS=Applications/System Utilities