Fix typo lockum -> locknum

This commit is contained in:
Bart House
2018-12-25 09:40:30 -08:00
parent 16db7498d0
commit ab73df996f
4 changed files with 31 additions and 31 deletions
+11 -11
View File
@@ -241,7 +241,7 @@ char *argv[];
if (wizard) { if (wizard) {
/* use character name rather than lock letter for file names */ /* use character name rather than lock letter for file names */
g.lockum = 0; g.locknum = 0;
} else { } else {
/* suppress interrupts while processing lock file */ /* suppress interrupts while processing lock file */
(void) signal(SIGQUIT, SIG_IGN); (void) signal(SIGQUIT, SIG_IGN);
@@ -266,14 +266,14 @@ attempt_restore:
/* /*
* getlock() complains and quits if there is already a game * getlock() complains and quits if there is already a game
* in progress for current character name (when g.lockum == 0) * in progress for current character name (when g.locknum == 0)
* or if there are too many active games (when g.lockum > 0). * or if there are too many active games (when g.locknum > 0).
* When proceeding, it creates an empty <lockname>.0 file to * When proceeding, it creates an empty <lockname>.0 file to
* designate the current game. * designate the current game.
* getlock() constructs <lockname> based on the character * getlock() constructs <lockname> based on the character
* name (for !g.lockum) or on first available of alock, block, * name (for !g.locknum) or on first available of alock, block,
* clock, &c not currently in use in the playground directory * clock, &c not currently in use in the playground directory
* (for g.lockum > 0). * (for g.locknum > 0).
*/ */
if (*g.plname) { if (*g.plname) {
getlock(); getlock();
@@ -327,7 +327,7 @@ attempt_restore:
if locking alphabetically, the existing lock file if locking alphabetically, the existing lock file
can still be used; otherwise, discard current one can still be used; otherwise, discard current one
and create another for the new character name */ and create another for the new character name */
if (!g.lockum) { if (!g.locknum) {
delete_levelfile(0); /* remove empty lock file */ delete_levelfile(0); /* remove empty lock file */
getlock(); getlock();
} }
@@ -452,17 +452,17 @@ char *argv[];
#else #else
/* XXX This is deprecated in favor of SYSCF with MAXPLAYERS */ /* XXX This is deprecated in favor of SYSCF with MAXPLAYERS */
if (argc > 1) if (argc > 1)
g.lockum = atoi(argv[1]); g.locknum = atoi(argv[1]);
#endif #endif
#ifdef MAX_NR_OF_PLAYERS #ifdef MAX_NR_OF_PLAYERS
/* limit to compile-time limit */ /* limit to compile-time limit */
if (!g.lockum || g.lockum > MAX_NR_OF_PLAYERS) if (!g.locknum || g.locknum > MAX_NR_OF_PLAYERS)
g.lockum = MAX_NR_OF_PLAYERS; g.locknum = MAX_NR_OF_PLAYERS;
#endif #endif
#ifdef SYSCF #ifdef SYSCF
/* let syscf override compile-time limit */ /* let syscf override compile-time limit */
if (!g.lockum || (sysopt.maxplayers && g.lockum > sysopt.maxplayers)) if (!g.locknum || (sysopt.maxplayers && g.locknum > sysopt.maxplayers))
g.lockum = sysopt.maxplayers; g.locknum = sysopt.maxplayers;
#endif #endif
} }
+5 -5
View File
@@ -119,15 +119,15 @@ getlock()
/* default value of lock[] is "1lock" where '1' gets changed to /* default value of lock[] is "1lock" where '1' gets changed to
'a','b',&c below; override the default and use <uid><charname> 'a','b',&c below; override the default and use <uid><charname>
if we aren't restricting the number of simultaneous games */ if we aren't restricting the number of simultaneous games */
if (!g.lockum) if (!g.locknum)
Sprintf(lock, "%u%s", (unsigned) getuid(), g.plname); Sprintf(lock, "%u%s", (unsigned) getuid(), g.plname);
regularize(lock); regularize(lock);
set_levelfile_name(lock, 0); set_levelfile_name(lock, 0);
if (g.lockum) { if (g.locknum) {
if (g.lockum > 25) if (g.locknum > 25)
g.lockum = 25; g.locknum = 25;
do { do {
lock[0] = 'a' + i++; lock[0] = 'a' + i++;
@@ -145,7 +145,7 @@ getlock()
if (veryold(fd) && eraseoldlocks()) if (veryold(fd) && eraseoldlocks())
goto gotlock; goto gotlock;
(void) close(fd); (void) close(fd);
} while (i < g.lockum); } while (i < g.locknum);
unlock_file(HLOCK); unlock_file(HLOCK);
error("Too many hacks running now."); error("Too many hacks running now.");
+9 -9
View File
@@ -141,7 +141,7 @@ char *argv[];
if (wizard) { if (wizard) {
/* use character name rather than lock letter for file names */ /* use character name rather than lock letter for file names */
g.lockum = 0; g.locknum = 0;
} else { } else {
/* suppress interrupts while processing lock file */ /* suppress interrupts while processing lock file */
(void) signal(SIGQUIT, SIG_IGN); (void) signal(SIGQUIT, SIG_IGN);
@@ -149,14 +149,14 @@ char *argv[];
} }
/* /*
* getlock() complains and quits if there is already a game * getlock() complains and quits if there is already a game
* in progress for current character name (when g.lockum == 0) * in progress for current character name (when g.locknum == 0)
* or if there are too many active games (when g.lockum > 0). * or if there are too many active games (when g.locknum > 0).
* When proceeding, it creates an empty <lockname>.0 file to * When proceeding, it creates an empty <lockname>.0 file to
* designate the current game. * designate the current game.
* getlock() constructs <lockname> based on the character * getlock() constructs <lockname> based on the character
* name (for !g.lockum) or on first available of alock, block, * name (for !g.locknum) or on first available of alock, block,
* clock, &c not currently in use in the playground directory * clock, &c not currently in use in the playground directory
* (for g.lockum > 0). * (for g.locknum > 0).
*/ */
getlock(); getlock();
@@ -212,7 +212,7 @@ attempt_restore:
if locking alphabetically, the existing lock file if locking alphabetically, the existing lock file
can still be used; otherwise, discard current one can still be used; otherwise, discard current one
and create another for the new character name */ and create another for the new character name */
if (!g.lockum) { if (!g.locknum) {
delete_levelfile(0); /* remove empty lock file */ delete_levelfile(0); /* remove empty lock file */
getlock(); getlock();
} }
@@ -315,10 +315,10 @@ char *argv[];
} }
if (argc > 1) if (argc > 1)
g.lockum = atoi(argv[1]); g.locknum = atoi(argv[1]);
#ifdef MAX_NR_OF_PLAYERS #ifdef MAX_NR_OF_PLAYERS
if (!g.lockum || g.lockum > MAX_NR_OF_PLAYERS) if (!g.locknum || g.locknum > MAX_NR_OF_PLAYERS)
g.lockum = MAX_NR_OF_PLAYERS; g.locknum = MAX_NR_OF_PLAYERS;
#endif #endif
} }
+6 -6
View File
@@ -109,16 +109,16 @@ getlock()
/* default value of lock[] is "1lock" where '1' gets changed to /* default value of lock[] is "1lock" where '1' gets changed to
'a','b',&c below; override the default and use <uid><charname> 'a','b',&c below; override the default and use <uid><charname>
if we aren't restricting the number of simultaneous games */ if we aren't restricting the number of simultaneous games */
if (!g.lockum) if (!g.locknum)
Sprintf(lock, "_%u%s", (unsigned) getuid(), plname); Sprintf(lock, "_%u%s", (unsigned) getuid(), plname);
regularize(lock); regularize(lock);
set_levelfile_name(lock, 0); set_levelfile_name(lock, 0);
if (g.lockum > 25) if (g.locknum > 25)
g.lockum = 25; g.locknum = 25;
do { do {
if (g.lockum) if (g.locknum)
lock[0] = 'a' + i++; lock[0] = 'a' + i++;
if ((fd = open(lock, 0, 0)) == -1) { if ((fd = open(lock, 0, 0)) == -1) {
@@ -132,10 +132,10 @@ getlock()
if (veryold(fd)) /* if true, this closes fd and unlinks lock */ if (veryold(fd)) /* if true, this closes fd and unlinks lock */
goto gotlock; goto gotlock;
(void) close(fd); (void) close(fd);
} while (i < g.lockum); } while (i < g.locknum);
unlock_file(HLOCK); unlock_file(HLOCK);
error(g.lockum ? "Too many hacks running now." error(g.locknum ? "Too many hacks running now."
: "There is a game in progress under your name."); : "There is a game in progress under your name.");
gotlock: gotlock: