summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-04-24 11:30:24 +0000
committerAndrew Tridgell <tridge@samba.org>2000-04-24 11:30:24 +0000
commite5b79f3d5b9f771032bdf92de177dc57f150d23a (patch)
treea062ffa1ef3fe00152156f607506638e11d28902
parentd315f69e542762efc54f1004e85c860dc5d7177a (diff)
downloadsamba-e5b79f3d5b9f771032bdf92de177dc57f150d23a.tar.gz
samba-e5b79f3d5b9f771032bdf92de177dc57f150d23a.tar.bz2
samba-e5b79f3d5b9f771032bdf92de177dc57f150d23a.zip
moved the INSURE hook into util.c
(This used to be commit 8c726b9764bac0bc95cf9877e172c9e1262e576d)
-rw-r--r--source3/lib/util.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index c27e96beea..981dd51f9d 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -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