summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--main.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/main.c b/main.c
index f09307b..86d72fa 100644
--- a/main.c
+++ b/main.c
@@ -165,7 +165,6 @@ main(int argc, char *argv[])
165 int i; 165 int i;
166 unsigned int mask; 166 unsigned int mask;
167 fd_set rd; 167 fd_set rd;
168 Bool readin = True;
169 Window w; 168 Window w;
170 XEvent ev; 169 XEvent ev;
171 XSetWindowAttributes wa; 170 XSetWindowAttributes wa;
@@ -252,8 +251,7 @@ main(int argc, char *argv[])
252 /* main event loop, reads status text from stdin as well */ 251 /* main event loop, reads status text from stdin as well */
253 while(running) { 252 while(running) {
254 FD_ZERO(&rd); 253 FD_ZERO(&rd);
255 if(readin) 254 FD_SET(STDIN_FILENO, &rd);
256 FD_SET(STDIN_FILENO, &rd);
257 FD_SET(ConnectionNumber(dpy), &rd); 255 FD_SET(ConnectionNumber(dpy), &rd);
258 256
259 i = select(ConnectionNumber(dpy) + 1, &rd, 0, 0, 0); 257 i = select(ConnectionNumber(dpy) + 1, &rd, 0, 0, 0);
@@ -269,12 +267,11 @@ main(int argc, char *argv[])
269 (handler[ev.type])(&ev); /* call handler */ 267 (handler[ev.type])(&ev); /* call handler */
270 } 268 }
271 } 269 }
272 if(readin && FD_ISSET(STDIN_FILENO, &rd)) { 270 if(FD_ISSET(STDIN_FILENO, &rd)) {
273 readin = NULL != fgets(stext, sizeof(stext), stdin); 271 if(!fgets(stext, sizeof(stext), stdin))
274 if(readin) 272 break;
275 stext[strlen(stext) - 1] = 0;
276 else 273 else
277 strcpy(stext, "broken pipe"); 274 stext[strlen(stext) - 1] = 0;
278 drawstatus(); 275 drawstatus();
279 } 276 }
280 } 277 }