X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=std.c;h=5bc27b8dfa34533842ee61135f23d6887f7ebdeb;hb=0cbcedb89ffe6e29b3c0640f371bed578c6e0c07;hp=daf759e5d4f444999e7c5f522559c7759ba062f0;hpb=f982c1c37ccc4adc38260a132aa64ee29d1a1a8c;p=st.git diff --git a/std.c b/std.c index daf759e..5bc27b8 100644 --- a/std.c +++ b/std.c @@ -1,5 +1,4 @@ /* See LICENSE file for copyright and license details. */ -#include "util.h" #include #include #include @@ -42,7 +41,7 @@ typedef struct { static int cols = 80, lines = 25; static int cx = 0, cy = 0; static int c; -int ptm, pts; +static int ptm, pts; static _Bool bold, digit, qmark; static pid_t pid; static RingBuffer buf; @@ -265,7 +264,6 @@ ungetch(int c) { int main(int argc, char *argv[]) { fd_set rfds; - int r; if(argc == 2 && !strcmp("-v", argv[1])) { fprintf(stderr, "std-"VERSION", © 2008 Matthias-Christian Ott\n"); @@ -281,8 +279,7 @@ main(int argc, char *argv[]) { FD_SET(STDIN_FILENO, &rfds); FD_SET(ptm, &rfds); for(;;) { - r = select(ptm + 1, &rfds, NULL, NULL, NULL); - if(r == -1) + if(select(ptm + 1, &rfds, NULL, NULL, NULL) == -1) err(EXIT_FAILURE, "cannot select"); if(FD_ISSET(ptm, &rfds)) { do {