X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fterminal%2Fterminal-reader.c;h=c23fad186f86992b164b401792ed3a1300f1706c;hb=fcebe62ed4634c3185f449593ba9fd438fb075d9;hp=2f2a533d1577f4d6cf46a95e3f60cd1b26ce7dd8;hpb=1e8aa549d8b7b19f814bbb08995aedb6a96630f6;p=pspp diff --git a/src/ui/terminal/terminal-reader.c b/src/ui/terminal/terminal-reader.c index 2f2a533d15..c23fad186f 100644 --- a/src/ui/terminal/terminal-reader.c +++ b/src/ui/terminal/terminal-reader.c @@ -264,13 +264,13 @@ interruptible_getc (FILE *fp) max_fd = (max_fd > fd) ? max_fd : fd; FD_SET (fd, &what); ret = select (max_fd + 1, &what, NULL, NULL, &timeout); - if ( ret == -1 && errno != EINTR) + if (ret == -1 && errno != EINTR) { perror ("Select failed"); continue; } - if (ret > 0 ) + if (ret > 0) { if (FD_ISSET (pfd[0], &what)) { @@ -302,10 +302,10 @@ handler (int sig) static void readline_init (void) { - if ( 0 != pipe2 (pfd, O_NONBLOCK)) + if (0 != pipe2 (pfd, O_NONBLOCK)) perror ("Cannot create pipe"); - if ( SIG_ERR == signal (SIGINT, handler)) + if (SIG_ERR == signal (SIGINT, handler)) perror ("Cannot add signal handler"); rl_catch_signals = 0; @@ -327,7 +327,7 @@ readline_init (void) static void readline_done (void) { - if (history_file != NULL && false == settings_get_testing_mode () ) + if (history_file != NULL && false == settings_get_testing_mode ()) write_history (history_file); clear_history (); free (history_file);