void my_name_is(int argc, char *argv[], const char *name)
{
char *l, *p, *q;
- char cpath[1024], npath[1024];
+ char cpath[1024];
int len;
bstrncpy(my_name, name, sizeof(my_name));
*q++ = *p++;
}
*q = 0;
- Dmsg1(200, "exepath=%s\n", exepath);
if (strchr(exepath, '.') || exepath[0] != '/') {
- npath[0] = 0;
if (getcwd(cpath, sizeof(cpath))) {
- if (chdir(exepath) == 0) {
- if (!getcwd(npath, sizeof(npath))) {
- npath[0] = 0;
- }
- chdir(cpath);
- }
- if (npath[0]) {
- free(exepath);
- exepath = (char *)malloc(strlen(npath) + 1 + len);
- strcpy(exepath, npath);
- }
+ free(exepath);
+ exepath = (char *)malloc(strlen(cpath) + 1 + len);
+ strcpy(exepath, cpath);
}
- Dmsg1(200, "Normalized exepath=%s\n", exepath);
}
+ Dmsg2(500, "exepath=%s\nexename=%s\n", exepath, exename);
}
}
fprintf(stderr, "Kaboom! %s, %s got signal %d. Attempting traceback.\n",
exename, my_name, sig);
+ fprintf(stderr, "Kaboom! exepath=%s\n", exepath);
if (exelen + 12 > (int)sizeof(btpath)) {
bstrncpy(btpath, "btraceback", sizeof(btpath));