diff --git a/games/xpipeman/Makefile b/games/xpipeman/Makefile index 32e0873a229f..a99d2f1cf02e 100644 --- a/games/xpipeman/Makefile +++ b/games/xpipeman/Makefile @@ -1,29 +1,29 @@ PORTNAME= xpipeman PORTVERSION= 1.5 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= games MASTER_SITES= SUNSITE/games/strategy DISTNAME= ${PORTNAME} MAINTAINER= ports@FreeBSD.org COMMENT= Connect the pipes to stop the leaks LICENSE= MIT USES= imake tar:Z xorg USE_XORG= x11 xaw xext xmu xt sm ice CFLAGS+= -Wno-error=return-type .include .if ${OPSYS} == FreeBSD CFLAGS+= -Wno-error=incompatible-function-pointer-types .endif do-install: ${INSTALL_PROGRAM} ${WRKSRC}/xpipeman ${STAGEDIR}${PREFIX}/bin ${INSTALL_MAN} ${WRKSRC}/xpipeman.man ${STAGEDIR}${PREFIX}/share/man/man6/xpipeman.6 ${INSTALL} -c ${FILESDIR}/xpipescores ${STAGEDIR}${PREFIX}/lib/X11 .include diff --git a/games/xpipeman/files/patch-score.c b/games/xpipeman/files/patch-score.c index fe30359ded31..c1334f3773f6 100644 --- a/games/xpipeman/files/patch-score.c +++ b/games/xpipeman/files/patch-score.c @@ -1,48 +1,71 @@ --- score.c.orig 1991-09-13 20:32:12 UTC +++ score.c @@ -50,8 +50,9 @@ #include #endif -#include /* brings in */ +#include #include +#include #include "xpipeman.h" /*----------------------------------------------------------------------*/ -@@ -64,13 +65,12 @@ typedef struct { +@@ -64,13 +65,12 @@ static SCORE scores[MAXSCORES]; static SCORE scores[MAXSCORES]; -void show_scores(), +static void show_scores(), new_high_score(), load_scores(), write_out_scores(); static FILE *scorefile = 0; -char *score_filename; /*----------------------------------------------------------------------*/ -@@ -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; - if( !(scorefile = fopen(score_filename,"r+")) ) { - scorefile = fopen(score_filename, "w"); + if( !(scorefile = fopen(app_data.score_filename,"r+")) ) { + scorefile = fopen(app_data.score_filename, "w"); 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[] = { /*ARGSUSED*/ -static XtCallbackProc +static void 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();