diff options
Diffstat (limited to 'games/xboing/files/patch-ad')
-rw-r--r-- | games/xboing/files/patch-ad | 216 |
1 files changed, 82 insertions, 134 deletions
diff --git a/games/xboing/files/patch-ad b/games/xboing/files/patch-ad index 7b5d3a776810..115a3ec70534 100644 --- a/games/xboing/files/patch-ad +++ b/games/xboing/files/patch-ad @@ -1,134 +1,82 @@ -*** highscore.c.orig Wed Jan 4 17:13:31 1995 ---- highscore.c Fri Apr 7 00:13:54 1995 -*************** -*** 54,59 **** ---- 54,60 ---- - #include <unistd.h> - #include <time.h> - #include <sys/param.h> -+ #include <sys/stat.h> - #include <netinet/in.h> - #include <X11/Xlib.h> - #include <X11/Xutil.h> -*************** -*** 118,124 **** - static void InitialiseHighScores(void); - static void SortHighScores(void); - static void DeleteScore(int i); -! static int LockUnlock(int cmd); - #else - static int LockUnlock(); - static void DeleteScore(); ---- 119,125 ---- - static void InitialiseHighScores(void); - static void SortHighScores(void); - static void DeleteScore(int i); -! static int LockUnlock(int cmd, int fd); - #else - static int LockUnlock(); - static void DeleteScore(); -*************** -*** 839,845 **** - - /* Lock the file for me only */ - if (type == GLOBAL) -! id = LockUnlock(LOCK_FILE); - - /* Read in the lastest scores */ - if (ReadHighScoreTable(type) == False) ---- 840,846 ---- - - /* Lock the file for me only */ - if (type == GLOBAL) -! id = LockUnlock(LOCK_FILE, -1); - - /* Read in the lastest scores */ - if (ReadHighScoreTable(type) == False) -*************** -*** 869,875 **** - else - { - /* Don't add as score is smaller */ -! return False; - } - } - } /* for */ ---- 870,876 ---- - else - { - /* Don't add as score is smaller */ -! goto doUnlock; - } - } - } /* for */ -*************** -*** 891,906 **** - - /* Unlock the file now thanks */ - if (id != -1) -! id = LockUnlock(UNLOCK_FILE); - - /* Yes - it was placed in the highscore */ - return True; - } - } - - /* Unlock the file now thanks */ - if (id != -1) -! id = LockUnlock(UNLOCK_FILE); - - /* Not even a highscore - loser! */ - return False; ---- 892,908 ---- - - /* Unlock the file now thanks */ - if (id != -1) -! id = LockUnlock(UNLOCK_FILE, id); - - /* Yes - it was placed in the highscore */ - return True; - } - } - -+ doUnlock: - /* Unlock the file now thanks */ - if (id != -1) -! id = LockUnlock(UNLOCK_FILE, id); - - /* Not even a highscore - loser! */ - return False; -*************** -*** 1178,1187 **** - } - - #if NeedFunctionPrototypes -! static int LockUnlock(int cmd) - #else -! static int LockUnlock(cmd) -! int cmd; - #endif - { - static int inter = -1; ---- 1180,1189 ---- - } - - #if NeedFunctionPrototypes -! static int LockUnlock(int cmd, int fd) - #else -! static int LockUnlock(cmd, fd) -! int cmd, fd; - #endif - { - static int inter = -1; -*************** -*** 1218,1223 **** ---- 1220,1228 ---- - /* Open the highscore file for both read & write */ - if (cmd == LOCK_FILE) - inter = open(filename, O_CREAT | O_RDWR, 0666); -+ else -+ /* use old fd to unlock */ -+ inter = fd; - - #ifndef NO_LOCKING - +--- highscore.c.orig Thu Nov 20 03:07:35 1997 ++++ highscore.c Thu Nov 20 03:12:23 1997 +@@ -55,6 +55,7 @@ + #include <time.h> + #include <file.h> + #include <sys/param.h> ++#include <sys/stat.h> + #include <X11/Xlib.h> + #include <X11/Xutil.h> + #include <X11/Xos.h> +@@ -119,7 +120,7 @@ + static void InitialiseHighScores(void); + static void SortHighScores(void); + static void DeleteScore(int i); +-static int LockUnlock(int cmd); ++static int LockUnlock(int cmd, int fd); + #else + static int LockUnlock(); + static void DeleteScore(); +@@ -844,7 +845,7 @@ + + /* Lock the file for me only */ + if (type == GLOBAL) +- id = LockUnlock(LOCK_FILE); ++ id = LockUnlock(LOCK_FILE, -1); + + /* Read in the lastest scores */ + if (ReadHighScoreTable(type) == False) +@@ -875,8 +876,8 @@ + { + /* Don't add as score is smaller */ + if (id != -1) +- id = LockUnlock(UNLOCK_FILE); +- return False; ++ id = LockUnlock(UNLOCK_FILE, id); ++ goto doUnlock; + } + } + } /* for */ +@@ -898,16 +899,17 @@ + + /* Unlock the file now thanks */ + if (id != -1) +- id = LockUnlock(UNLOCK_FILE); ++ id = LockUnlock(UNLOCK_FILE, id); + + /* Yes - it was placed in the highscore */ + return True; + } + } + ++doUnlock: + /* Unlock the file now thanks */ + if (id != -1) +- id = LockUnlock(UNLOCK_FILE); ++ id = LockUnlock(UNLOCK_FILE, id); + + /* Not even a highscore - loser! */ + return False; +@@ -1185,10 +1187,10 @@ + } + + #if NeedFunctionPrototypes +-static int LockUnlock(int cmd) ++static int LockUnlock(int cmd, int fd) + #else + static int LockUnlock(cmd) +- int cmd; ++ int cmd, fd; + #endif + { + static int inter = -1; +@@ -1225,6 +1227,9 @@ + /* Open the highscore file for both read & write */ + if (cmd == LOCK_FILE) + inter = open(filename, O_CREAT | O_RDWR, 0666); ++ else ++ /* use old fd to unlock */ ++ inter = fd; + + #ifndef NO_LOCKING + |