twe close stdin as well - dwm - [fork] customized build of dwm, the dynamic win… | |
git clone git://src.adamsgaard.dk/dwm | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 727449d1e7840bae1700d722168a73def9738ccd | |
parent 80bf2aa5592da311fb712e63b66aeec560df2b56 | |
Author: Anselm R.Garbe <[email protected]> | |
Date: Wed, 16 Aug 2006 09:31:41 +0200 | |
we close stdin as well | |
Diffstat: | |
M main.c | 7 ++++--- | |
1 file changed, 4 insertions(+), 3 deletions(-) | |
--- | |
diff --git a/main.c b/main.c | |
t@@ -18,11 +18,12 @@ | |
/* static */ | |
static int (*xerrorxlib)(Display *, XErrorEvent *); | |
-static Bool otherwm; | |
+static Bool otherwm, readin; | |
static void | |
cleanup() | |
{ | |
+ close(STDIN_FILENO); | |
while(sel) { | |
resize(sel, True, TopLeft); | |
unmanage(sel); | |
t@@ -146,7 +147,7 @@ sendevent(Window w, Atom a, long value) | |
void | |
quit(Arg *arg) | |
{ | |
- running = False; | |
+ readin = running = False; | |
} | |
/* | |
t@@ -176,7 +177,6 @@ main(int argc, char *argv[]) | |
int i, j, xfd; | |
unsigned int mask; | |
fd_set rd; | |
- Bool readin = True; | |
Window w; | |
XModifierKeymap *modmap; | |
XSetWindowAttributes wa; | |
t@@ -279,6 +279,7 @@ main(int argc, char *argv[]) | |
/* main event loop, also reads status text from stdin */ | |
XSync(dpy, False); | |
procevent(); | |
+ readin = True; | |
while(running) { | |
FD_ZERO(&rd); | |
if(readin) |