about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--main.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/main.c b/main.c
index 42c9d8a..b59ff96 100644
--- a/main.c
+++ b/main.c
@@ -190,6 +190,7 @@ main(int argc, char *argv[])
 	fd_set rd;
 	XSetWindowAttributes wa;
 	unsigned int mask;
+	Bool readstdin = True;
 	Window w;
 	XEvent ev;
 
@@ -283,7 +284,8 @@ main(int argc, char *argv[])
 Mainloop:
 	while(running) {
 		FD_ZERO(&rd);
-		FD_SET(STDIN_FILENO, &rd);
+		if(readstdin)
+			FD_SET(STDIN_FILENO, &rd);
 		FD_SET(ConnectionNumber(dpy), &rd);
 
 		i = select(ConnectionNumber(dpy) + 1, &rd, 0, 0, 0);
@@ -299,11 +301,13 @@ Mainloop:
 						(handler[ev.type])(&ev); /* call handler */
 				}
 			}
-			if(FD_ISSET(STDIN_FILENO, &rd)) {
+			if(readstdin && FD_ISSET(STDIN_FILENO, &rd)) {
 				i = n = 0;
 				for(;;) {
 					if((i = getchar()) == EOF) {
-						stext[0] = 0;
+						/* broken pipe/end of producer */
+						readstdin = False;
+						strcpy(stext, "broken pipe");
 						goto Mainloop;
 					}
 					if(i == '\n' || n >= sizeof(stext) - 1)
'Blame the previous revision' href='/akspecs/ranger/blame/doc/ranger.fsobject.html?id=4e01caf19cfbc798862e6b8b2dbd77328c8f99a2'>^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

                                                              
                                                                   






                                                                                                                                                                                
                                                                                                                                                                                                                       











                                                                                                                                             
                                                                       





                                                                                               
                                                                  
             
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: package ranger.fsobject</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="ranger.html"><font color="#ffffff">ranger</font></a>.fsobject</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/hut/code/ranger/ranger/fsobject/__init__.py">/home/hut/code/ranger/ranger/fsobject/__init__.py</a></font></td></tr></table>
    <p><tt>FileSystemObjects&nbsp;are&nbsp;representation&nbsp;of&nbsp;files&nbsp;and&nbsp;directories<br>
with&nbsp;fast&nbsp;access&nbsp;to&nbsp;their&nbsp;properties&nbsp;through&nbsp;caching</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Package Contents</strong></big></font></td></tr>
    
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="ranger.fsobject.directory.html">directory</a><br>
</td><td width="25%" valign=top><a href="ranger.fsobject.file.html">file</a><br>
</td><td width="25%" valign=top><a href="ranger.fsobject.fsobject.html">fsobject</a><br>
</td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
    
<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><strong>BAD_INFO</strong> = '?'</td></tr></table>
</body></html>