9front - general discussion about 9front
 help / color / mirror / Atom feed
* [9front] [PATCH] Fix drawterm build failure on FreeBSD
@ 2021-10-07 22:07 Christos Margiolis
  0 siblings, 0 replies; only message in thread
From: Christos Margiolis @ 2021-10-07 22:07 UTC (permalink / raw)
  To: 9front

[-- Attachment #1: Type: text/plain, Size: 143 bytes --]

Build was failing due to a conflict with FreeBSD's fdclose(3). On
FreeBSD it's declared as:

int
fdclose(FILE *stream, int *fdp);

--
Christos

[-- Attachment #2: 9front_sysfile.diff --]
[-- Type: text/x-diff, Size: 608 bytes --]

diff --git a/kern/sysfile.c b/kern/sysfile.c
index 04af4e3..413c0eb 100644
--- a/kern/sysfile.c
+++ b/kern/sysfile.c
@@ -293,7 +293,7 @@ _sysopen(char *name, int mode)
 }
 
 static void
-fdclose(int fd, int flag)
+_fdclose(int fd, int flag)
 {
 	int i;
 	Chan *c;
@@ -325,7 +325,7 @@ long
 _sysclose(int fd)
 {
 	fdtochan(fd, -1, 0, 0);
-	fdclose(fd, 0);
+	_fdclose(fd, 0);
 
 	return 0;
 }
@@ -698,7 +698,7 @@ bindmount(int ismount, int fd, int afd, char* arg0, char* arg1, int flag, char*
 	poperror();
 	cclose(c0);
 	if(ismount){
-		fdclose(fd, 0);
+		_fdclose(fd, 0);
 		poperror();
 		free(spec);
 	}


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-08  0:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-07 22:07 [9front] [PATCH] Fix drawterm build failure on FreeBSD Christos Margiolis

9front - general discussion about 9front

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.vuxu.org/9front

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 9front 9front/ https://inbox.vuxu.org/9front \
		9front@9front.org
	public-inbox-index 9front

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.9front


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git