Date: Tue, 10 Feb 2026 15:41:02 +0000 From: Robert Clausecker <fuz@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Cc: Kristofer Peterson <kris@tranception.com> Subject: git: ac2ba2b1dcbb - main - games/xrobots: use portable fileno() instead of (*FILE)->_file Message-ID: <698b518e.45ae5.71d5ee5e@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/ports/commit/?id=ac2ba2b1dcbbeca1847f9deb06810483add94834 commit ac2ba2b1dcbbeca1847f9deb06810483add94834 Author: Kristofer Peterson <kris@tranception.com> AuthorDate: 2026-02-04 20:27:02 +0000 Commit: Robert Clausecker <fuz@FreeBSD.org> CommitDate: 2026-02-10 15:40:36 +0000 games/xrobots: use portable fileno() instead of (*FILE)->_file PR: 292939, 291610 MFH: 2026Q1 --- games/xrobots/Makefile | 2 +- games/xrobots/files/patch-score.c | 25 ++++++++++++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/games/xrobots/Makefile b/games/xrobots/Makefile index 13a08fcbdfac..c7719cd34cd9 100644 --- a/games/xrobots/Makefile +++ b/games/xrobots/Makefile @@ -1,6 +1,6 @@ PORTNAME= xrobots PORTVERSION= 1.0 -PORTREVISION= 6 +PORTREVISION= 7 CATEGORIES= games MASTER_SITES= http://www.mavetju.org/download/adopted/ DISTNAME= ${PORTNAME}-${PORTVERSION}-ss-10.20 diff --git a/games/xrobots/files/patch-score.c b/games/xrobots/files/patch-score.c index 549ee2d1f197..fbe0e5eb4cf5 100644 --- a/games/xrobots/files/patch-score.c +++ b/games/xrobots/files/patch-score.c @@ -8,7 +8,7 @@ #include "xrobots.h" /*----------------------------------------------------------------------*/ -@@ -67,14 +68,13 @@ typedef struct { +@@ -67,14 +68,13 @@ static SCORE scores[MAXSCORES]; static SCORE scores[MAXSCORES]; @@ -24,6 +24,15 @@ /*----------------------------------------------------------------------*/ +@@ -91,7 +91,7 @@ check_score(current_score) + } + if(scorefile) { + #ifndef SYSV +- flock(scorefile->_file, LOCK_UN); ++ flock(fileno(scorefile), LOCK_UN); + #endif + fclose(scorefile); + show_scores(); @@ -103,19 +103,20 @@ static void load_scores() { int i = 0; @@ -35,7 +44,8 @@ return; } #ifndef SYSV - flock(scorefile->_file, LOCK_EX); +- flock(scorefile->_file, LOCK_EX); ++ flock(fileno(scorefile), LOCK_EX); #endif - while( fgets(scores[i].score,6,scorefile) /* get score */ - && fgets(scores[i].name,26,scorefile) /* get name */ @@ -62,7 +72,7 @@ popdown_callback(w, closure, call_data) Widget w; caddr_t closure; -@@ -253,7 +254,7 @@ void +@@ -253,7 +254,7 @@ show_scores() show_scores() { int i; @@ -71,3 +81,12 @@ Arg tmp_arg; for(i = 0;i<MAXSCORES;i++) { +@@ -276,7 +277,7 @@ show_scores_callback() + + if(scorefile) { + #ifndef SYSV +- flock(scorefile->_file, LOCK_UN); ++ flock(fileno(scorefile), LOCK_UN); + #endif + fclose(scorefile); + show_scores();home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?698b518e.45ae5.71d5ee5e>
