Fixed fatal-signal handler looping.
authorshort <>
Thu, 28 Aug 2003 19:49:35 +0000 (19:49 +0000)
committershort <>
Thu, 28 Aug 2003 19:49:35 +0000 (19:49 +0000)
src/libcaptive/sandbox/split.c

index 9ea1232..780ca64 100644 (file)
@@ -397,10 +397,6 @@ static void sandbox_parent_own_orbit_dir_cleanup_sighandler(int signum)
 {
 struct sandbox_parent_own_orbit_dir_cleanup_signal *sigstructp;
 
-       g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: signum=%d",G_STRLOC,signum);
-
-       sandbox_parent_own_orbit_dir_cleanup_atexit();
-
        for (
                        sigstructp=sandbox_parent_own_orbit_dir_cleanup_signals;
                        sigstructp<sandbox_parent_own_orbit_dir_cleanup_signals+G_N_ELEMENTS(sandbox_parent_own_orbit_dir_cleanup_signals);
@@ -409,8 +405,14 @@ struct sandbox_parent_own_orbit_dir_cleanup_signal *sigstructp;
                        break;
                }
        g_assert(sigstructp<sandbox_parent_own_orbit_dir_cleanup_signals+G_N_ELEMENTS(sandbox_parent_own_orbit_dir_cleanup_signals));
-       g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: sighandler_orig=%p,re-raising...",G_STRLOC,sigstructp->sighandler_orig);
        signal(signum,sigstructp->sighandler_orig);
+
+       /* Prevent recursive fatal logging before signal restore: */
+       g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: signum=%d,sighandler_orig=%p",G_STRLOC,signum,sigstructp->sighandler_orig);
+
+       sandbox_parent_own_orbit_dir_cleanup_atexit();
+
+       g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: re-raising...",G_STRLOC);
        raise(signum);
 }