VirtualBox

Ignore:
Timestamp:
Oct 20, 2009 8:55:51 AM (15 years ago)
Author:
vboxsync
Message:

temporarily back out r53642, r53640

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/init.cpp

    r23871 r23892  
    4242# ifndef RT_OS_OS2
    4343#  include <pthread.h>
    44 #  include <signal.h>
    45 #  include <errno.h>
    46 #  define IPRT_USE_SIG_CHILD_DUMMY
    4744# endif
    4845#endif
     
    207204}
    208205
    209 
    210 #ifdef IPRT_USE_SIG_CHILD_DUMMY
    211 /**
    212  * Dummy SIGCHILD handler.
    213  *
    214  * Assigned on rtR3Init only when SIGCHILD handler is set SIGIGN or SIGDEF to
    215  * ensure waitpid works properly for the terminated processes.
    216  */
    217 static void rtR3SigChildHandler(int iSignal)
    218 {
    219     NOREF(iSignal);
    220 }
    221 #endif /* IPRT_USE_SIG_CHILD_DUMMY */
    222 
    223 
    224206/**
    225207 * rtR3Init worker.
     
    314296    atexit(rtR3ExitCallback);
    315297
    316 #ifdef IPRT_USE_SIG_CHILD_DUMMY
    317     /*
    318      * SIGCHLD must not be ignored (that's default), otherwise posix compliant waitpid
    319      * implementations won't work right.
    320      */
    321     for (;;)
    322     {
    323         struct sigaction saOld;
    324         rc = sigaction(SIGCHLD, 0, &saOld);         AssertMsg(rc == 0, ("%d/%d\n", rc, errno));
    325         if (    rc != 0
    326             ||  (saOld.sa_flags & SA_SIGINFO)
    327             || (   saOld.sa_handler != SIG_IGN
    328                 && saOld.sa_handler != SIG_DFL)
    329            )
    330             break;
    331 
    332         /* Try install dummy handler. */
    333         struct sigaction saNew = saOld;
    334         saNew.sa_flags   = SA_NOCLDSTOP | SA_RESTART;
    335         saNew.sa_handler = rtR3SigChildHandler;
    336         rc = sigemptyset(&saNew.sa_mask);           AssertMsg(rc == 0, ("%d/%d\n", rc, errno));
    337         struct sigaction saOld2;
    338         rc = sigaction(SIGCHLD, &saNew, &saOld2);   AssertMsg(rc == 0, ("%d/%d\n", rc, errno));
    339         if (    rc != 0
    340             ||  (   saOld2.sa_handler == saOld.sa_handler
    341                  && !(saOld2.sa_flags & SA_SIGINFO))
    342            )
    343             break;
    344 
    345         /* Race during dynamic load, restore and try again... */
    346         sigaction(SIGCHLD, &saOld2, NULL);
    347         RTThreadYield();
    348     }
    349 #endif /* IPRT_USE_SIG_CHILD_DUMMY */
    350 
    351298#ifdef IPRT_WITH_ALIGNMENT_CHECKS
    352299    /*
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette