peek(1): more style fixes

This commit is contained in:
dtb 2024-07-26 07:58:34 -06:00
parent d892fa1cac
commit 16dcd4da37
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
* sigaction(2) methods. sigaction(2) is vastly preferred for
* portability but some configurations can only use signal(2). */
@ -95,13 +95,13 @@ int main(int argc, char *argv[]){
struct sigaction act = { 0 };
act.sa_handler = restore_echo;
if(sigaction(SIGINT, &act, NULL) != 0) { perror(program_name); }
if (sigaction(SIGINT, &act, NULL) != 0) { perror(program_name); }
#else
if(signal(SIGINT, restore_echo) == SIG_ERR) { perror(program_name); }
if (signal(SIGINT, restore_echo) == SIG_ERR) { perror(program_name); }
#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. */
{
struct termios t;
@ -117,7 +117,7 @@ int main(int argc, char *argv[]){
int c;
while ((c = fgetc(stdin)) != EOF) {
if(fputc(c, stdout) == EOF) { return ioerr(program_name); }
if (fputc(c, stdout) == EOF) { return ioerr(program_name); }
}
}