diff options
author | dok <dok@grehack.fr> | 2019-01-26 15:49:15 +0100 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2019-01-27 15:26:04 +0100 |
commit | 11a65377da8fc198d15cf041dbbbb9718e5798cd (patch) | |
tree | 115f1723d96014635c17cd24342f952903760c44 | |
parent | bbc464dc80225b8cf9390f14fac6c682f63940d2 (diff) |
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.
-rw-r--r-- | dmenu.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -6,9 +6,7 @@ | |||
6 | #include <string.h> | 6 | #include <string.h> |
7 | #include <strings.h> | 7 | #include <strings.h> |
8 | #include <time.h> | 8 | #include <time.h> |
9 | #ifdef __OpenBSD__ | ||
10 | #include <unistd.h> | 9 | #include <unistd.h> |
11 | #endif | ||
12 | 10 | ||
13 | #include <X11/Xlib.h> | 11 | #include <X11/Xlib.h> |
14 | #include <X11/Xatom.h> | 12 | #include <X11/Xatom.h> |
@@ -754,7 +752,7 @@ main(int argc, char *argv[]) | |||
754 | die("pledge"); | 752 | die("pledge"); |
755 | #endif | 753 | #endif |
756 | 754 | ||
757 | if (fast) { | 755 | if (fast && !isatty(0)) { |
758 | grabkeyboard(); | 756 | grabkeyboard(); |
759 | readstdin(); | 757 | readstdin(); |
760 | } else { | 758 | } else { |