Use slow path if stdin is a tty
If stdin is a tty and dmenu is ran with the fast option then it's impossible to close stdin because the keyboard is already grabbed.
This commit is contained in:
		
							
								
								
									
										4
									
								
								dmenu.c
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								dmenu.c
									
									
									
									
									
								
							@@ -6,9 +6,7 @@
 | 
				
			|||||||
#include <string.h>
 | 
					#include <string.h>
 | 
				
			||||||
#include <strings.h>
 | 
					#include <strings.h>
 | 
				
			||||||
#include <time.h>
 | 
					#include <time.h>
 | 
				
			||||||
#ifdef __OpenBSD__
 | 
					 | 
				
			||||||
#include <unistd.h>
 | 
					#include <unistd.h>
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <X11/Xlib.h>
 | 
					#include <X11/Xlib.h>
 | 
				
			||||||
#include <X11/Xatom.h>
 | 
					#include <X11/Xatom.h>
 | 
				
			||||||
@@ -754,7 +752,7 @@ main(int argc, char *argv[])
 | 
				
			|||||||
		die("pledge");
 | 
							die("pledge");
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (fast) {
 | 
						if (fast && !isatty(0)) {
 | 
				
			||||||
		grabkeyboard();
 | 
							grabkeyboard();
 | 
				
			||||||
		readstdin();
 | 
							readstdin();
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user