VirtualBox

Changeset 21139 in vbox


Ignore:
Timestamp:
Jul 1, 2009 6:23:59 PM (15 years ago)
Author:
vboxsync
Message:

VBoxService: Fixed handling of disabled services.

File:
1 edited

Legend:

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

    r19532 r21139  
    278278    VBoxServiceVerbose(2, "Initializing services ...\n");
    279279    for (unsigned j = 0; j < RT_ELEMENTS(g_aServices); j++)
    280     {
    281         rc = g_aServices[j].pDesc->pfnInit();
    282         if (RT_FAILURE(rc))
     280        if (g_aServices[j].fEnabled)
    283281        {
    284             VBoxServiceError("Service '%s' failed pre-init: %Rrc\n", g_aServices[j].pDesc->pszName);
    285             return rc;
     282
     283            rc = g_aServices[j].pDesc->pfnInit();
     284            if (RT_FAILURE(rc))
     285            {
     286                VBoxServiceError("Service '%s' failed pre-init: %Rrc\n", g_aServices[j].pDesc->pszName);
     287                return rc;
     288            }
    286289        }
    287     }
    288290
    289291    /*
     
    342344            g_aServices[j].pDesc->pfnStop();
    343345    for (unsigned j = 0; j < RT_ELEMENTS(g_aServices); j++)
    344     {
    345         if (g_aServices[j].Thread != NIL_RTTHREAD)
     346        if (g_aServices[j].fEnabled)
    346347        {
    347             int rc = RTThreadWait(g_aServices[j].Thread, 30*1000, NULL);
    348             if (RT_FAILURE(rc))
    349                 VBoxServiceError("Service '%s' failed to stop. (%Rrc)\n", g_aServices[j].pDesc->pszName, rc);
     348            if (g_aServices[j].Thread != NIL_RTTHREAD)
     349            {
     350                int rc = RTThreadWait(g_aServices[j].Thread, 30*1000, NULL);
     351                if (RT_FAILURE(rc))
     352                    VBoxServiceError("Service '%s' failed to stop. (%Rrc)\n", g_aServices[j].pDesc->pszName, rc);
     353            }
     354            g_aServices[j].pDesc->pfnTerm();
    350355        }
    351         g_aServices[j].pDesc->pfnTerm();
    352     }
    353356
    354357    VBoxServiceVerbose(2, "Stopping services returned: rc=%Rrc\n", rc);
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