| 157 | } |
| 158 | |
| 159 | static int |
| 160 | eraseoldlocks() |
| 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 | |
| 179 | void |
| 180 | getlock() |
nothing calls this directly
no test coverage detected