Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Sep 2001 22:46:12 +0800 (CST)
From:      Yen-Ming Lee <leeym@utopia.leeym.com>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/30457: update port: chinese/zhcon
Message-ID:  <200109091446.f89EkCC57014@utopia.leeym.com>

next in thread | raw e-mail | index | archive | help

>Number:         30457
>Category:       ports
>Synopsis:       update port: chinese/zhcon
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Sun Sep 09 07:50:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Yen-Ming Lee
>Release:        FreeBSD 4.4-RC i386
>Organization:
>Environment:
System: FreeBSD utopia.leeym.com 4.4-RC FreeBSD 4.4-RC #27: Sun Sep 9 12:37:32 CST 2001 root@utopia.leeym.com:/usr/obj/usr/src/sys/UTOPIA i386


	
>Description:

modify bsdfactory.cpp to avoid "mmap() failed!" on -STABLE

>How-To-Repeat:
	
>Fix:

diff -ruN /usr/ports/chinese/zhcon/files/patch-ab zhcon/files/patch-ab
--- /usr/ports/chinese/zhcon/files/patch-ab	Thu Jan  1 08:00:00 1970
+++ zhcon/files/patch-ab	Sun Sep  9 13:54:14 2001
@@ -0,0 +1,28 @@
+--- zhcon/bsdfactory.cpp.orig	Sun Sep  9 13:19:32 2001
++++ zhcon/bsdfactory.cpp	Sun Sep  9 13:54:13 2001
+@@ -102,11 +102,24 @@
+     }
+ 
+     printf ("len %d\n", buflen);
++#if (__FreeBSD__ <= 3)
+     if ((vga = open("/dev/vga", O_RDWR | O_NDELAY)) < 0) {
++#else
++    if ((vga = open("/dev/mem", O_RDWR | O_NDELAY)) < 0) {
++#endif
+ 	throw(runtime_error("Can not open vga device.\n"));
+     }
+ 
+-    buf = static_cast<char *>(mmap(0, buflen, PROT_READ | PROT_WRITE, MAP_SHARED, vga, 0));
++    if ((buf = static_cast<char *>(valloc(buflen))) == NULL) {
++        throw(runtime_error("Can not open vga device.\n"));
++    }
++
++#if (__FreeBSD__ <= 3)
++#define GRAPH_BASE 0x0
++#else
++#define GRAPH_BASE 0xA0000
++#endif
++    buf = static_cast<char *>(mmap(buf, buflen, PROT_READ | PROT_WRITE, MAP_FILE|MAP_SHARED|MAP_FIXED, vga, GRAPH_BASE));
+     close(vga);
+ 
+     if (buf == MAP_FAILED)
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200109091446.f89EkCC57014>