summaryrefslogtreecommitdiff
path: root/chinese
diff options
context:
space:
mode:
authorClive Lin <clive@FreeBSD.org>2001-09-09 18:07:00 +0000
committerClive Lin <clive@FreeBSD.org>2001-09-09 18:07:00 +0000
commita91258372a78658d26d381513e000b9542e779b6 (patch)
treeedff7763f5b8d9674cc3725460742cc09de89009 /chinese
parentBring in file attributes bugfix from snap-16.1d. (diff)
Add a patch to avoid "mmap() failed!" message for non-root users.
PR: ports/30457 Submitted by: Yen-Ming Lee <leeym@utopia.leeym.com>
Notes
Notes: svn path=/head/; revision=47581
Diffstat (limited to 'chinese')
-rw-r--r--chinese/zhcon/files/patch-ab28
1 files changed, 28 insertions, 0 deletions
diff --git a/chinese/zhcon/files/patch-ab b/chinese/zhcon/files/patch-ab
new file mode 100644
index 000000000000..58d1e54162de
--- /dev/null
+++ b/chinese/zhcon/files/patch-ab
@@ -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)