]> git.ozlabs.org Git - ccan-lca-2011.git/blobdiff - ccan/oserver/oserver.c
lca2011: dump talloc tree in child.
[ccan-lca-2011.git] / ccan / oserver / oserver.c
index c7a523c21ff121f9f0ace96895216e143d3d2131..ad8f31538ec31663c90624490217b1c6936f5294 100644 (file)
@@ -314,10 +314,16 @@ static void talloc_dump(struct tevent_context *ev,
                        void *_oserver)
 {
        struct oserver *oserver = _oserver;
-       FILE *f = fopen("/var/run/oserver/talloc.dump", "w");
-       if (f) {
-               talloc_report_full(oserver, f);
-               fclose(f);
+       FILE *f;
+
+       /* Fork off a child for the report, so we aren't stopped. */
+       if (fork() == 0) {
+               f = fopen("/var/run/oserver/talloc.dump", "w");
+               if (f) {
+                       talloc_report_full(oserver, f);
+                       fclose(f);
+               }
+               _exit(0);
        }
 }