peek(1): more style fixes

This commit is contained in:
dtb 2024-07-26 07:58:34 -06:00
parent a927c39c06
commit 3f23e437e8
Signed by: trinity
GPG Key ID: 34C0543BBB6AF81B

View File

@ -85,7 +85,7 @@ int main(int argc, char *argv[]){
} }
} }
{ /* install signal handler */ { /* Install signal handler */
/* There isn't a difference in functionality between the signal(2) and /* There isn't a difference in functionality between the signal(2) and
* sigaction(2) methods. sigaction(2) is vastly preferred for * sigaction(2) methods. sigaction(2) is vastly preferred for
* portability but some configurations can only use signal(2). */ * portability but some configurations can only use signal(2). */
@ -95,13 +95,13 @@ int main(int argc, char *argv[]){
struct sigaction act = { 0 }; struct sigaction act = { 0 };
act.sa_handler = restore_echo; act.sa_handler = restore_echo;
if(sigaction(SIGINT, &act, NULL) != 0) { perror(program_name); } if (sigaction(SIGINT, &act, NULL) != 0) { perror(program_name); }
#else #else
if(signal(SIGINT, restore_echo) == SIG_ERR) { perror(program_name); } if (signal(SIGINT, restore_echo) == SIG_ERR) { perror(program_name); }
#endif #endif
} }
/* Banish terminal echo; this terminates when it fails, because this is the /* Banish terminal echo; this terminates when it fails, because it's the
* whole point of the program. */ * whole point of the program. */
{ {
struct termios t; struct termios t;
@ -117,7 +117,7 @@ int main(int argc, char *argv[]){
int c; int c;
while ((c = fgetc(stdin)) != EOF) { while ((c = fgetc(stdin)) != EOF) {
if(fputc(c, stdout) == EOF) { return ioerr(program_name); } if (fputc(c, stdout) == EOF) { return ioerr(program_name); }
} }
} }