summaryrefslogtreecommitdiffstats
path: root/sys/dev/si
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1999-04-27 11:18:52 +0000
committerphk <phk@FreeBSD.org>1999-04-27 11:18:52 +0000
commit16e3fbd2c114d665755299002f1c50dd11ba7245 (patch)
treed7f6bebfe177ae90b67d27603da4d211433088e5 /sys/dev/si
parentaba5e776bb95610ea3e3355cbf47aadb844773eb (diff)
downloadFreeBSD-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/dev/si')
-rw-r--r--sys/dev/si/si.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/dev/si/si.c b/sys/dev/si/si.c
index 7dae243..670ef14 100644
--- a/sys/dev/si/si.c
+++ b/sys/dev/si/si.c
@@ -30,7 +30,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
* NO EVENT SHALL THE AUTHORS BE LIABLE.
*
- * $Id: si.c,v 1.79 1999/01/30 12:17:34 phk Exp $
+ * $Id: si.c,v 1.80 1999/04/24 20:17:03 peter Exp $
*/
#ifndef lint
@@ -1132,7 +1132,7 @@ siopen(dev, flag, mode, p)
/* quickly let in /dev/si_control */
if (IS_CONTROLDEV(mynor)) {
- if ((error = suser(p->p_ucred, &p->p_acflag)))
+ if ((error = suser(p)))
return(error);
return(0);
}
@@ -1210,7 +1210,7 @@ open_top:
}
}
if (tp->t_state & TS_XCLUDE &&
- suser(p->p_ucred, &p->p_acflag)) {
+ suser(p)) {
DPRINT((pp, DBG_OPEN|DBG_FAIL,
"already open and EXCLUSIVE set\n"));
error = EBUSY;
@@ -1525,7 +1525,7 @@ siioctl(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;
@@ -1635,7 +1635,7 @@ siioctl(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) {
goto outspl;
}
@@ -1692,7 +1692,7 @@ si_Sioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
ip = (int *)data;
-#define SUCHECK if ((error = suser(p->p_ucred, &p->p_acflag))) goto out
+#define SUCHECK if ((error = suser(p))) goto out
switch (cmd) {
case TCSIPORTS:
OpenPOWER on IntegriCloud