1
0
mirror of https://git.freebsd.org/ports.git synced 2026-06-02 11:08:52 +00:00

games/xpipeman: use portable fileno() instead of (*FILE)->_file

PR:		292939, 291610
MFH:		2026Q1
This commit is contained in:
Kristofer Peterson
2026-02-04 21:24:55 +01:00
committed by Robert Clausecker
parent 7ce98714b8
commit 003fed6b7b
2 changed files with 26 additions and 3 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
PORTNAME= xpipeman
PORTVERSION= 1.5
PORTREVISION= 2
PORTREVISION= 3
CATEGORIES= games
MASTER_SITES= SUNSITE/games/strategy
DISTNAME= ${PORTNAME}
+25 -2
View File
@@ -11,7 +11,7 @@
#include "xpipeman.h"
/*----------------------------------------------------------------------*/
@@ -64,13 +65,12 @@ typedef struct {
@@ -64,13 +65,12 @@ static SCORE scores[MAXSCORES];
static SCORE scores[MAXSCORES];
@@ -26,7 +26,16 @@
/*----------------------------------------------------------------------*/
@@ -100,8 +100,8 @@ load_scores()
@@ -87,7 +87,7 @@ check_score(current_score,level)
}
if(scorefile) {
#ifndef SYSV
- flock(scorefile->_file, LOCK_UN);
+ flock(fileno(scorefile), LOCK_UN);
#endif
fclose(scorefile);
show_scores();
@@ -100,12 +100,12 @@ load_scores()
{
int i = 0;
@@ -37,6 +46,11 @@
return;
}
#ifndef SYSV
- 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 */
@@ -198,7 +198,7 @@ static Arg arglist_popdown[] = {
@@ -46,3 +60,12 @@
popdown_callback(w, closure, call_data)
Widget w;
caddr_t closure;
@@ -281,7 +281,7 @@ show_scores_callback()
if(scorefile) {
#ifndef SYSV
- flock(scorefile->_file, LOCK_UN);
+ flock(fileno(scorefile), LOCK_UN);
#endif
fclose(scorefile);
show_scores();