In some cases, for SPARC servers, special files like fifo need to open in 
nonblocking mode otherwise whole xconsole GUI freezes. Also /dev/console is 
often a terminal device.  So I am opening /dev/console with NOCTTY and 
O_NONBLOCK flags.

Signed-off-by: Arvind Umrao <[email protected]>
---
 xconsole.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/xconsole.c b/xconsole.c
index adbc298..d8067e5 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.9.2

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to