summaryrefslogtreecommitdiff
path: root/utils/w.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1998-10-20 09:48:26 +0000
committerRoland McGrath <roland@gnu.org>1998-10-20 09:48:26 +0000
commitcaf7ac6e90416c95f67a381835980e3da3570eb0 (patch)
tree28077a76d06d42200c6a432d37d51e50b377d467 /utils/w.c
parentfc40a731d23f893be2cb7699d7e078568d4c210c (diff)
Add braces to silence gcc warnings.
Diffstat (limited to 'utils/w.c')
-rw-r--r--utils/w.c46
1 files changed, 24 insertions, 22 deletions
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)