BSD 1 development
[unix-history] / trek / damaged.c
CommitLineData
520d5775
EA
1# include "trek.h"
2
3/* DAMAGED -- check for device damaged
4**
5** This is a boolean function which returns non-zero if the
6** specified device is broken. It does this by checking the
7** event list for a "device fix" action on that device.
8*/
9
10damaged(dev)
11int dev;
12{
13 register int d;
14 register struct event *e;
15 register int i;
16
17 d = dev;
18
19 for (i = 0; i < MAXEVENTS; i++)
20 {
21 e = &Event[i];
22 if (e->evcode != E_FIXDV)
23 continue;
24 if (e->systemname == d)
25 return (1);
26 }
27
28 /* device fix not in event list -- device must not be broken */
29 return (0);
30}