diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2017-08-18 21:30:02 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2017-08-18 21:30:02 +0000 |
commit | 7f3f5b1c412474fbd6bc4c9b615a396eb8ca946d (patch) | |
tree | b77fc1c0b75348a031cd5bea7705756f25ea25ec /sys/dev/wsfont | |
parent | 2c2f39062eb4351fc9fba3074f4b0e79a8ebaed1 (diff) |
Backout because it breaks ramdisks. Anyone making changes in the kernel
is required to consider or test ramdisks before commit.
Diffstat (limited to 'sys/dev/wsfont')
-rw-r--r-- | sys/dev/wsfont/wsfont.c | 45 |
1 files changed, 1 insertions, 44 deletions
diff --git a/sys/dev/wsfont/wsfont.c b/sys/dev/wsfont/wsfont.c index e4d41c37274..052440619a1 100644 --- a/sys/dev/wsfont/wsfont.c +++ b/sys/dev/wsfont/wsfont.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsfont.c,v 1.50 2017/08/18 20:19:36 fcambus Exp $ */ +/* $OpenBSD: wsfont.c,v 1.51 2017/08/18 21:30:01 deraadt Exp $ */ /* $NetBSD: wsfont.c,v 1.17 2001/02/07 13:59:24 ad Exp $ */ /*- @@ -40,8 +40,6 @@ #include <dev/wscons/wsconsio.h> #include <dev/wsfont/wsfont.h> -#include <lib/libz/zlib.h> - #include "wsfont_glue.h" /* NRASOPS_ROTATION */ #undef HAVE_FONT @@ -157,7 +155,6 @@ static const u_char reverse[256] = { #endif static struct font *wsfont_find0(int); -static int wsfont_inflate(struct wsdisplay_font *); #ifdef INCLUDE_FONT_BIT_ENDIANNESS_SWAP_CODE @@ -531,12 +528,6 @@ wsfont_lock(int cookie, struct wsdisplay_font **ptr, int bitorder, s = splhigh(); if ((ent = wsfont_find0(cookie)) != NULL) { - /* Decompress font data if necessary */ - if (ent->font->data == NULL && - ent->font->zdata && ent->font->zdata_len) - if (wsfont_inflate(ent->font)) - return -1; - if (bitorder && bitorder != ent->font->bitorder) { #ifdef INCLUDE_FONT_BIT_ENDIANNESS_SWAP_CODE if (ent->lockcount) { @@ -762,37 +753,3 @@ wsfont_map_unichar(struct wsdisplay_font *font, int c) return (-1); } - -/* - * Inflate a compressed font - */ -static int -wsfont_inflate(struct wsdisplay_font *font) { - int fontdata_len = font->fontheight * font->stride * font->numchars; - z_stream zstream; - - font->data = malloc(fontdata_len, M_DEVBUF, M_WAITOK); - if (font->data == NULL) - return ENOMEM; - - memset(&zstream, 0, sizeof(zstream)); - zstream.next_in = font->zdata; - zstream.avail_in = font->zdata_len; - zstream.next_out = font->data; - zstream.avail_out = fontdata_len; - zstream.opaque = Z_NULL; - - if (inflateInit(&zstream) != Z_OK) - return -1; - - if (inflate(&zstream, Z_FINISH) != Z_STREAM_END) - return -1; - - if (inflateEnd(&zstream) != Z_OK) - return -1; - - if (zstream.total_out != fontdata_len) - return -1; - - return 0; -} |