summaryrefslogtreecommitdiffstats
path: root/usr.sbin/watch
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2012-03-10 14:38:34 +0000
committered <ed@FreeBSD.org>2012-03-10 14:38:34 +0000
commitdcd36056779c198d6255444fcf758180f5e38cf7 (patch)
tree3aa6a9306f5c486eada0cf5a229d041cd30e45c5 /usr.sbin/watch
parent7cb90c0dddc86ff69c4110235c8dbfbf4442190b (diff)
downloadFreeBSD-src-dcd36056779c198d6255444fcf758180f5e38cf7.zip
FreeBSD-src-dcd36056779c198d6255444fcf758180f5e38cf7.tar.gz
Perform even more style changes.
- Remove unneeded whitespace for function calls. - Add empty line at the top of functions without local variables. - Change while (1) to for (;;). MFC after: 1 week
Diffstat (limited to 'usr.sbin/watch')
-rw-r--r--usr.sbin/watch/watch.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/usr.sbin/watch/watch.c b/usr.sbin/watch/watch.c
index f66e124..e69534d 100644
--- a/usr.sbin/watch/watch.c
+++ b/usr.sbin/watch/watch.c
@@ -110,7 +110,7 @@ set_tty(void)
{
struct termios ntty;
- tcgetattr (std_in, &otty);
+ tcgetattr(std_in, &otty);
ntty = otty;
ntty.c_lflag &= ~ICANON; /* disable canonical operation */
ntty.c_lflag &= ~ECHO;
@@ -128,18 +128,20 @@ set_tty(void)
ntty.c_cc[VINTR] = 07; /* ^G */
ntty.c_cc[VQUIT] = 07; /* ^G */
- tcsetattr (std_in, TCSANOW, &ntty);
+ tcsetattr(std_in, TCSANOW, &ntty);
}
static void
unset_tty(void)
{
- tcsetattr (std_in, TCSANOW, &otty);
+
+ tcsetattr(std_in, TCSANOW, &otty);
}
static void
fatal(int error, const char *buf)
{
+
unset_tty();
if (buf)
errx(error, "fatal: %s", buf);
@@ -170,6 +172,7 @@ open_snp(void)
static void
cleanup(int signo __unused)
{
+
if (opt_timestamp)
timestamp("Logging Exited.");
close(snp_io);
@@ -180,6 +183,7 @@ cleanup(int signo __unused)
static void
usage(void)
{
+
fprintf(stderr, "usage: watch [-ciotnW] [tty name]\n");
exit(EX_USAGE);
}
@@ -344,7 +348,7 @@ main(int ac, char *av[])
FD_ZERO(&fd_s);
- while (1) {
+ for (;;) {
if (opt_interactive)
FD_SET(std_in, &fd_s);
FD_SET(snp_io, &fd_s);
OpenPOWER on IntegriCloud