diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2008-06-15 15:31:56 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2008-06-15 15:31:56 +0000 |
commit | f3a24b9210915d49a0c28b5379923e300af88833 (patch) | |
tree | 4ddfa9582a18eed9bb595549876cef3103a999f1 /sys | |
parent | 4add2143f97d9aa27d32a108323ff65fa763769d (diff) |
When APERTURE is not defined, always return ENXIO.
Suggested by mk@, ok miod@ deraadt@.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/i386/i386/amdmsr.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/arch/i386/i386/amdmsr.c b/sys/arch/i386/i386/amdmsr.c index 95b9d8791f5..38ea7534678 100644 --- a/sys/arch/i386/i386/amdmsr.c +++ b/sys/arch/i386/i386/amdmsr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: amdmsr.c,v 1.2 2008/06/15 01:18:22 deraadt Exp $ */ +/* $OpenBSD: amdmsr.c,v 1.3 2008/06/15 15:31:55 matthieu Exp $ */ /* * Copyright (c) 2008 Marc Balmer <mbalmer@openbsd.org> @@ -82,17 +82,17 @@ amdmsr_attach(struct device *parent, struct device *self, void *aux) int amdmsropen(dev_t dev, int flags, int devtype, struct proc *p) { - if (suser(p, 0) != 0) - return EPERM; #ifdef APERTURE - if (!allowaperture) + if (suser(p, 0) != 0 || !allowaperture) return EPERM; -#endif /* allow only one simultaneous open() */ if (amdmsr_open_cnt > 0) return EPERM; amdmsr_open_cnt++; return 0; +#else + return ENXIO; +#endif } int |