MCPcopy Create free account
hub / github.com/NetHack/NetHack / eraseoldlocks

Function eraseoldlocks

outdated/sys/wince/winhack.c:159–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

157}
158
159static int
160eraseoldlocks()
161{
162 register int i;
163
164 /* cannot use maxledgerno() here, because we need to find a lock name
165 * before starting everything (including the dungeon initialization
166 * that sets astral_level, needed for maxledgerno()) up
167 */
168 for (i = 1; i <= MAXDUNGEON * MAXLEVEL + 1; i++) {
169 /* try to remove all */
170 set_levelfile_name(gl.lock, i);
171 (void) unlink(fqname(gl.lock, LEVELPREFIX, 0));
172 }
173 set_levelfile_name(gl.lock, 0);
174 if (unlink(fqname(gl.lock, LEVELPREFIX, 0)))
175 return 0; /* cannot remove it */
176 return (1); /* success! */
177}
178
179void
180getlock()

Callers

nothing calls this directly

Calls 3

unlinkFunction · 0.85
fqnameFunction · 0.85
set_levelfile_nameFunction · 0.50

Tested by

no test coverage detected