VirtualBox

Changeset 29633 in vbox for trunk/src/VBox/Additions/common


Ignore:
Timestamp:
May 18, 2010 1:29:03 PM (15 years ago)
Author:
vboxsync
Message:

VBoxService.cpp: Ignore sigwait interruptions. Attempt to work around SIGCHLD on solaris.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/VBoxService.cpp

    r29594 r29633  
    363363            VBoxServiceVerbose(1, "Main service '%s' successfully stopped.\n", g_aServices[iMain].pDesc->pszName);
    364364        else /* Only complain if service returned an error. Otherwise the service is a one-timer. */
    365             VBoxServiceError("Service '%s' stopped unexpected; rc=%Rrc\n", g_aServices[iMain].pDesc->pszName, rc);           
     365            VBoxServiceError("Service '%s' stopped unexpected; rc=%Rrc\n", g_aServices[iMain].pDesc->pszName, rc);
    366366        g_aServices[iMain].pDesc->pfnTerm();
    367367    }
     
    419419
    420420#ifdef RT_OS_WINDOWS
    421     /* 
    422      * As we're now done terminating all service threads, 
     421    /*
     422     * As we're now done terminating all service threads,
    423423     * we have to stop the main thread as well (if defined). Note that the termination
    424424     * function will be called in a later context (when the main thread returns from the worker
     
    430430
    431431        ASMAtomicXchgBool(&g_fShutdown, true);
    432         g_aServices[iMain].pDesc->pfnStop();                     
    433     }
    434 #endif
    435    
     432        g_aServices[iMain].pDesc->pfnStop();
     433    }
     434#endif
     435
    436436    VBoxServiceVerbose(2, "Stopping services returned: rc=%Rrc\n", rc);
    437437    return rc;
     
    454454    sigaddset(&signalMask, SIGTERM);
    455455    pthread_sigmask(SIG_BLOCK, &signalMask, NULL);
    456     sigwait(&signalMask, &iSignal);
    457     VBoxServiceVerbose(3, "VBoxServiceWaitSignal: Received signal %d\n", iSignal);
     456
     457    do
     458        iSignal = -1;
     459    while (   sigwait(&signalMask, &iSignal) == -1
     460           && (   errno == EINTR
     461               || errno == ERESTART));
     462
     463    VBoxServiceVerbose(3, "VBoxServiceWaitSignal: Received signal %d (errno=%d)\n", iSignal, errno);
    458464}
    459465#endif /* !RT_OS_WINDOWS */
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