1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00

moved the INSURE hook into util.c

This commit is contained in:
Andrew Tridgell 0001-01-01 00:00:00 +00:00
parent ba1931bb65
commit 8c726b9764

View File

@ -2651,3 +2651,29 @@ char *parent_dirname(const char *path)
}
return dirpath;
}
#ifdef __INSURE__
int _Insure_trap_error(int a1, int a2, int a3, int a4, int a5, int a6)
{
static int (*fn)();
int ret;
char pidstr[10];
pstring cmd = "/usr/X11R6/bin/xterm -display :0 -T Panic -n Panic -e /bin/sh -c 'cat /tmp/ierrs.*.%d ; gdb /proc/%d/exe %d'";
slprintf(pidstr, sizeof(pidstr), "%d", getpid());
pstring_sub(cmd, "%d", pidstr);
if (!fn) {
static void *h;
h = dlopen("/usr/local/parasoft/insure++lite/lib.linux2/libinsure.so", RTLD_LAZY);
fn = dlsym(h, "_Insure_trap_error");
}
ret = fn(a1, a2, a3, a4, a5, a6);
system(cmd);
return ret;
}
#endif