shithub: drawterm

Download patch

ref: 911c97608ef1bce09b8e62355344e301c9b250d4
parent: 4d702dcec6014d5c7c9769642954697d91d9afb9
author: cinap_lenrek <[email protected]>
date: Fri Dec 16 15:14:30 EST 2016

fix build on freebsd (thanks mveety)

- freebsd compiler is now clang
- /usr/X11R6 -> /usr/local
- avoid name clash with freebsd's fdclose()

--- a/Make.freebsd
+++ b/Make.freebsd
@@ -3,8 +3,8 @@
 AR=ar
 AS=as
 RANLIB=ranlib
-X11=/usr/X11R6
-CC=gcc
+X11=/usr/local
+CC=clang
 CFLAGS=-Wall -Wno-missing-braces -ggdb -I$(ROOT) -I$(ROOT)/include -I$(ROOT)/kern -c -I$(X11)/include -D_THREAD_SAFE $(PTHREAD) -O2
 O=o
 OS=posix
--- a/kern/fns.h
+++ b/kern/fns.h
@@ -90,7 +90,6 @@
 void		exit(int);
 uvlong		fastticks(uvlong*);
 int		fault(ulong, int);
-void		fdclose(int, int);
 Chan*		fdtochan(int, int, int, int);
 int		fixfault(Segment*, ulong, int, int);
 void		flushmmu(void);
--- a/kern/sysfile.c
+++ b/kern/sysfile.c
@@ -292,8 +292,8 @@
 	return fd;
 }
 
-void
-fdclose(int fd, int flag)
+static void
+closefd(int fd, int flag)
 {
 	int i;
 	Chan *c;
@@ -325,7 +325,7 @@
 _sysclose(int fd)
 {
 	fdtochan(fd, -1, 0, 0);
-	fdclose(fd, 0);
+	closefd(fd, 0);
 
 	return 0;
 }
@@ -711,7 +711,7 @@
 	poperror();
 	cclose(c0);
 	if(ismount)
-		fdclose(fd, 0);
+		closefd(fd, 0);
 
 	return ret;
 }