diff options
author | phk <phk@FreeBSD.org> | 1999-04-27 11:18:52 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1999-04-27 11:18:52 +0000 |
commit | 16e3fbd2c114d665755299002f1c50dd11ba7245 (patch) | |
tree | d7f6bebfe177ae90b67d27603da4d211433088e5 /sys/gnu/i386 | |
parent | aba5e776bb95610ea3e3355cbf47aadb844773eb (diff) | |
download | FreeBSD-src-16e3fbd2c114d665755299002f1c50dd11ba7245.zip FreeBSD-src-16e3fbd2c114d665755299002f1c50dd11ba7245.tar.gz |
Suser() simplification:
1:
s/suser/suser_xxx/
2:
Add new function: suser(struct proc *), prototyped in <sys/proc.h>.
3:
s/suser_xxx(\([a-zA-Z0-9_]*\)->p_ucred, \&\1->p_acflag)/suser(\1)/
The remaining suser_xxx() calls will be scrutinized and dealt with
later.
There may be some unneeded #include <sys/cred.h>, but they are left
as an exercise for Bruce.
More changes to the suser() API will come along with the "jail" code.
Diffstat (limited to 'sys/gnu/i386')
-rw-r--r-- | sys/gnu/i386/isa/dgb.c | 8 | ||||
-rw-r--r-- | sys/gnu/i386/isa/dgm.c | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/sys/gnu/i386/isa/dgb.c b/sys/gnu/i386/isa/dgb.c index 1e53116..c640622 100644 --- a/sys/gnu/i386/isa/dgb.c +++ b/sys/gnu/i386/isa/dgb.c @@ -1,5 +1,5 @@ /*- - * dgb.c $Id: dgb.c,v 1.43 1999/03/13 13:20:54 joerg Exp $ + * dgb.c $Id: dgb.c,v 1.44 1999/04/22 15:19:37 davidn Exp $ * * Digiboard driver. * @@ -1034,7 +1034,7 @@ open_top: } } if (tp->t_state & TS_XCLUDE && - suser(p->p_ucred, &p->p_acflag)) { + suser(p)) { error = EBUSY; goto out; } @@ -1579,7 +1579,7 @@ dgbioctl(dev, cmd, data, flag, p) } switch (cmd) { case TIOCSETA: - error = suser(p->p_ucred, &p->p_acflag); + error = suser(p); if (error != 0) return (error); *ct = *(struct termios *)data; @@ -1801,7 +1801,7 @@ dgbioctl(dev, cmd, data, flag, p) break; case TIOCMSDTRWAIT: /* must be root since the wait applies to following logins */ - error = suser(p->p_ucred, &p->p_acflag); + error = suser(p); if (error != 0) { splx(s); return (error); diff --git a/sys/gnu/i386/isa/dgm.c b/sys/gnu/i386/isa/dgm.c index 68ef91c..97ff12f 100644 --- a/sys/gnu/i386/isa/dgm.c +++ b/sys/gnu/i386/isa/dgm.c @@ -1,5 +1,5 @@ /*- - * $Id: dgm.c,v 1.7 1999/01/30 12:17:32 phk Exp $ + * $Id: dgm.c,v 1.8 1999/04/11 03:47:24 eivind Exp $ * * This driver and the associated header files support the ISA PC/Xem * Digiboards. Its evolutionary roots are described below. @@ -834,7 +834,7 @@ open_top: } } if (tp->t_state & TS_XCLUDE && - suser(p->p_ucred, &p->p_acflag)) { + suser(p)) { error = EBUSY; goto out; } @@ -1378,7 +1378,7 @@ dgmioctl(dev, cmd, data, flag, p) } switch (cmd) { case TIOCSETA: - error = suser(p->p_ucred, &p->p_acflag); + error = suser(p); if (error != 0) return (error); *ct = *(struct termios *)data; @@ -1600,7 +1600,7 @@ dgmioctl(dev, cmd, data, flag, p) break; case TIOCMSDTRWAIT: /* must be root since the wait applies to following logins */ - error = suser(p->p_ucred, &p->p_acflag); + error = suser(p); if (error != 0) { splx(s); return (error); |