diff options
author | Roland McGrath <roland@gnu.org> | 1998-10-20 09:48:26 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1998-10-20 09:48:26 +0000 |
commit | caf7ac6e90416c95f67a381835980e3da3570eb0 (patch) | |
tree | 28077a76d06d42200c6a432d37d51e50b377d467 /utils/w.c | |
parent | fc40a731d23f893be2cb7699d7e078568d4c210c (diff) |
Add braces to silence gcc warnings.
Diffstat (limited to 'utils/w.c')
-rw-r--r-- | utils/w.c | 46 |
1 files changed, 24 insertions, 22 deletions
@@ -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) |