aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/cy
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>1999-04-27 11:18:52 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>1999-04-27 11:18:52 +0000
commitf711d546d27edc6115841ef780df0252d44a996d (patch)
treed19d0988b873086bf6eda1c6543fc9257015af3d /sys/dev/cy
parentd5483ddfbae9694934b27c4e7f23a4f0d3e0f5f4 (diff)
downloadsrc-f711d546d27edc6115841ef780df0252d44a996d.tar.gz
src-f711d546d27edc6115841ef780df0252d44a996d.zip
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.
Notes
Notes: svn path=/head/; revision=46112
Diffstat (limited to 'sys/dev/cy')
-rw-r--r--sys/dev/cy/cy.c8
-rw-r--r--sys/dev/cy/cy_isa.c8
2 files changed, 8 insertions, 8 deletions
diff --git a/sys/dev/cy/cy.c b/sys/dev/cy/cy.c
index e513c051eb58..6947d095f7bb 100644
--- a/sys/dev/cy/cy.c
+++ b/sys/dev/cy/cy.c
@@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: cy.c,v 1.85 1999/01/30 12:17:33 phk Exp $
+ * $Id: cy.c,v 1.86 1999/02/04 15:54:02 bde Exp $
*/
#include "opt_compat.h"
@@ -718,7 +718,7 @@ open_top:
}
}
if (tp->t_state & TS_XCLUDE &&
- suser(p->p_ucred, &p->p_acflag)) {
+ suser(p)) {
error = EBUSY;
goto out;
}
@@ -1623,7 +1623,7 @@ sioioctl(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;
@@ -1722,7 +1722,7 @@ sioioctl(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/dev/cy/cy_isa.c b/sys/dev/cy/cy_isa.c
index e513c051eb58..6947d095f7bb 100644
--- a/sys/dev/cy/cy_isa.c
+++ b/sys/dev/cy/cy_isa.c
@@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: cy.c,v 1.85 1999/01/30 12:17:33 phk Exp $
+ * $Id: cy.c,v 1.86 1999/02/04 15:54:02 bde Exp $
*/
#include "opt_compat.h"
@@ -718,7 +718,7 @@ open_top:
}
}
if (tp->t_state & TS_XCLUDE &&
- suser(p->p_ucred, &p->p_acflag)) {
+ suser(p)) {
error = EBUSY;
goto out;
}
@@ -1623,7 +1623,7 @@ sioioctl(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;
@@ -1722,7 +1722,7 @@ sioioctl(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);