| 232 | } |
| 233 | |
| 234 | void |
| 235 | getlock(void) |
| 236 | { |
| 237 | int fd; |
| 238 | |
| 239 | Sprintf(gl.lock, "%d%s", getuid(), svp.plname); |
| 240 | regularize(gl.lock); |
| 241 | set_levelfile_name(gl.lock, 0); |
| 242 | fd = creat(gl.lock, FCMASK); |
| 243 | if (fd == -1) { |
| 244 | error("cannot creat lock file."); |
| 245 | } else { |
| 246 | if (write(fd, (genericptr_t) &svh.hackpid, sizeof(svh.hackpid)) |
| 247 | != sizeof(svh.hackpid)) { |
| 248 | error("cannot write lock"); |
| 249 | } |
| 250 | if (close(fd) == -1) { |
| 251 | error("cannot close lock"); |
| 252 | } |
| 253 | } |
| 254 | } |
| 255 | |
| 256 | /* validate wizard mode if player has requested access to it */ |
| 257 | boolean |
no test coverage detected