From caf7ac6e90416c95f67a381835980e3da3570eb0 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Tue, 20 Oct 1998 09:48:26 +0000 Subject: Add braces to silence gcc warnings. --- utils/w.c | 46 ++++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-) (limited to 'utils/w.c') diff --git a/utils/w.c b/utils/w.c index 1107bb05..eb1734c3 100644 --- a/utils/w.c +++ b/utils/w.c @@ -135,28 +135,30 @@ w_fetch (struct proc_stat *ps, ps_flags_t need, ps_flags_t have) } if (need & W_PSTAT_IDLE) - if (have & PSTAT_TTY) - { - struct stat stat; - struct ps_tty *tty = ps->tty; - - hook->idle.tv_usec = 0; - if (! tty) - { - hook->idle.tv_sec = 0; - have |= W_PSTAT_IDLE; - } - else - { - if (io_stat (tty->port, &stat) == 0) - { - hook->idle.tv_sec = now.tv_sec - stat.st_atime; - have |= W_PSTAT_IDLE; - } - } - } - else if (ps->inapp & PSTAT_TTY) - ps->inapp |= W_PSTAT_IDLE; + { + if (have & PSTAT_TTY) + { + struct stat stat; + struct ps_tty *tty = ps->tty; + + hook->idle.tv_usec = 0; + if (! tty) + { + hook->idle.tv_sec = 0; + have |= W_PSTAT_IDLE; + } + else + { + if (io_stat (tty->port, &stat) == 0) + { + hook->idle.tv_sec = now.tv_sec - stat.st_atime; + have |= W_PSTAT_IDLE; + } + } + } + else if (ps->inapp & PSTAT_TTY) + ps->inapp |= W_PSTAT_IDLE; + } if (need & W_PSTAT_USER) if (ps_user_uname_create (hook->utmp.ut_name, &hook->user) == 0) -- cgit v1.2.3