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

Function chdirx

sys/vms/vmsmain.c:344–370  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

342
343#ifdef CHDIR
344void
345chdirx(const char *dir, boolean wr)
346{
347#ifndef HACKDIR
348 static const char *defdir = ".";
349#else
350 static const char *defdir = HACKDIR;
351
352 if (dir == (const char *) 0)
353 dir = defdir;
354 else if (wr && !same_dir(HACKDIR, dir))
355 /* If we're playing anywhere other than HACKDIR, turn off any
356 privs we may have been installed with. */
357 privoff();
358#endif
359
360 if (dir && chdir(dir) < 0) {
361 perror(dir);
362 error("Cannot chdir to %s.", dir);
363 }
364
365 /* warn the player if we can't write the record file */
366 if (wr)
367 check_recordfile(dir);
368
369 defdir = dir;
370}
371#endif /* CHDIR */
372
373static void

Callers 6

mainFunction · 0.70
vms_doshellFunction · 0.70
do_deferred_showpathsFunction · 0.50
opt_usageFunction · 0.50
after_opt_showpathsFunction · 0.50
scores_onlyFunction · 0.50

Calls 5

same_dirFunction · 0.85
privoffFunction · 0.85
check_recordfileFunction · 0.85
chdirFunction · 0.50
errorFunction · 0.50

Tested by

no test coverage detected