/*
- * $Id: main.cc,v 1.341 2001/09/03 23:01:45 wessels Exp $
+ * $Id: main.cc,v 1.342 2001/10/03 09:16:13 hno Exp $
*
* DEBUG: section 1 Startup and Main Loop
* AUTHOR: Harvest Derived
static void
mainSetCwd(void)
{
- char *p;
+ char pathbuf[MAXPATHLEN];
if (Config.coredump_dir) {
if (0 == strcmp("none", Config.coredump_dir)) {
(void) 0;
}
}
/* If we don't have coredump_dir or couldn't cd there, report current dir */
- p = getcwd(NULL, 0);
- debug(0, 1) ("Current Directory is %s\n", p);
- xfree(p);
+ if (getcwd(pathbuf, MAXPATHLEN)) {
+ debug(0, 1) ("Current Directory is %s\n", pathbuf);
+ } else {
+ debug(50, 0) ("WARNING: Can't find current directory, getcwd: %s\n", xstrerror());
+ }
}
static void