summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/vesa.c
diff options
context:
space:
mode:
authoryokota <yokota@FreeBSD.org>1999-12-07 11:23:58 +0000
committeryokota <yokota@FreeBSD.org>1999-12-07 11:23:58 +0000
commit6969be118893d65257541cd82a7fbea8ef969586 (patch)
tree3ac9fbeb111927e58f3cd8245b6f95580c397879 /sys/i386/isa/vesa.c
parentd29133dba78088590a688c17b161e9000781e9cf (diff)
downloadFreeBSD-src-6969be118893d65257541cd82a7fbea8ef969586.zip
FreeBSD-src-6969be118893d65257541cd82a7fbea8ef969586.tar.gz
Fix the ioctl CONS_FINDMODE and its underlying subroutine
xxx_query_mode() in the vga and vesa drivers. - xxx_query_mode() returns 0 (success) and a positive error number. - Copy mode information on success. - Remove redundant structure copy. The bug first found in -STABLE by jmg.
Diffstat (limited to 'sys/i386/isa/vesa.c')
-rw-r--r--sys/i386/isa/vesa.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/i386/isa/vesa.c b/sys/i386/isa/vesa.c
index a209251..ee2e463 100644
--- a/sys/i386/isa/vesa.c
+++ b/sys/i386/isa/vesa.c
@@ -937,10 +937,10 @@ vesa_query_mode(video_adapter_t *adp, video_info_t *info)
{
int i;
- if ((i = (*prevvidsw->query_mode)(adp, info)) != -1)
- return i;
+ if ((*prevvidsw->query_mode)(adp, info) == 0)
+ return 0;
if (adp != vesa_adp)
- return -1;
+ return ENODEV;
for (i = 0; vesa_vmode[i].vi_mode != EOT; ++i) {
if ((info->vi_width != 0)
@@ -965,9 +965,10 @@ vesa_query_mode(video_adapter_t *adp, video_info_t *info)
if ((info->vi_flags != 0)
&& (info->vi_flags != vesa_vmode[i].vi_flags))
continue;
- return vesa_vmode[i].vi_mode;
+ *info = vesa_vmode[i];
+ return 0;
}
- return -1;
+ return ENODEV;
}
static int
OpenPOWER on IntegriCloud