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

Function chdirx

sys/windows/windmain.c:1309–1323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1307
1308#ifdef CHDIR
1309void
1310chdirx(const char *dir, boolean wr)
1311{
1312 static char thisdir[] = ".";
1313
1314 if (dir && chdir(dir) < 0) {
1315 error("Cannot chdir to %s.", dir);
1316 }
1317
1318 /* warn the player if we can't write the record file */
1319 /* perhaps we should also test whether . is writable */
1320 /* unfortunately the access system-call is worthless */
1321 if (wr)
1322 check_recordfile(dir ? dir : thisdir);
1323}
1324#endif /* CHDIR */
1325
1326void

Callers 1

getlockFunction · 0.70

Calls 3

check_recordfileFunction · 0.85
chdirFunction · 0.50
errorFunction · 0.50

Tested by

no test coverage detected