shithub: drawterm

Download patch

ref: 911c97608ef1bce09b8e62355344e301c9b250d4
parent: 4d702dcec6014d5c7c9769642954697d91d9afb9
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Fri Dec 16 14: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	Fri Dec 16 14:12:49 2016
+++ b/Make.freebsd	Fri Dec 16 14:14:30 2016
@@ -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	Fri Dec 16 14:12:49 2016
+++ b/kern/fns.h	Fri Dec 16 14:14:30 2016
@@ -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	Fri Dec 16 14:12:49 2016
+++ b/kern/sysfile.c	Fri Dec 16 14:14:30 2016
@@ -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;
 }