git: 5ddfedf4ebb6 - 2026Q1 - games/xrobots: use portable fileno() instead of (*FILE)->_file
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 10 Feb 2026 15:42:27 UTC
The branch 2026Q1 has been updated by fuz:
URL: https://cgit.FreeBSD.org/ports/commit/?id=5ddfedf4ebb67176e53d0ddd8d614671d4f383e0
commit 5ddfedf4ebb67176e53d0ddd8d614671d4f383e0
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:42:12 +0000
games/xrobots: use portable fileno() instead of (*FILE)->_file
PR: 292939, 291610
MFH: 2026Q1
(cherry picked from commit ac2ba2b1dcbbeca1847f9deb06810483add94834)
---
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();