peek(1): more style fixes
This commit is contained in:
parent
a927c39c06
commit
3f23e437e8
10
src/peek.c
10
src/peek.c
@ -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); }
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user