diff options
author | yokota <yokota@FreeBSD.org> | 1999-12-07 11:23:58 +0000 |
---|---|---|
committer | yokota <yokota@FreeBSD.org> | 1999-12-07 11:23:58 +0000 |
commit | 6969be118893d65257541cd82a7fbea8ef969586 (patch) | |
tree | 3ac9fbeb111927e58f3cd8245b6f95580c397879 /sys/dev/fb/vga.c | |
parent | d29133dba78088590a688c17b161e9000781e9cf (diff) | |
download | FreeBSD-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/dev/fb/vga.c')
-rw-r--r-- | sys/dev/fb/vga.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/dev/fb/vga.c b/sys/dev/fb/vga.c index 6c96dae..f733e47 100644 --- a/sys/dev/fb/vga.c +++ b/sys/dev/fb/vga.c @@ -1441,11 +1441,10 @@ vga_get_info(video_adapter_t *adp, int mode, video_info_t *info) static int vga_query_mode(video_adapter_t *adp, video_info_t *info) { - video_info_t buf; int i; if (!vga_init_done) - return -1; + return ENXIO; for (i = 0; bios_vmode[i].vi_mode != EOT; ++i) { if (bios_vmode[i].vi_mode == NA) @@ -1475,11 +1474,11 @@ vga_query_mode(video_adapter_t *adp, video_info_t *info) continue; /* verify if this mode is supported on this adapter */ - if (vga_get_info(adp, bios_vmode[i].vi_mode, &buf)) + if (vga_get_info(adp, bios_vmode[i].vi_mode, info)) continue; - return bios_vmode[i].vi_mode; + return 0; } - return -1; + return ENODEV; } /* |