VirtualBox

Ignore:
Timestamp:
Apr 15, 2016 12:20:51 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
106633
Message:

ValidationKit/usb: Updates for UsbTestService

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/utils/usb/UsbTestService.cpp

    r60493 r60517  
    5858#include "UsbTestServiceInternal.h"
    5959#include "UsbTestServiceGadget.h"
     60#include "UsbTestServicePlatform.h"
    6061
    6162
     
    10451046    if (RT_SUCCESS(rc))
    10461047    {
    1047         rc = RTCritSectInit(&g_CritSectClients);
     1048        rc = utsPlatformInit();
    10481049        if (RT_SUCCESS(rc))
    10491050        {
    1050             rc = RTPipeCreate(&g_hPipeR, &g_hPipeW, 0);
     1051            rc = RTCritSectInit(&g_CritSectClients);
    10511052            if (RT_SUCCESS(rc))
    10521053            {
    1053                 /* Spin off the thread serving connections. */
    1054                 rc = RTThreadCreate(&g_hThreadServing, utsClientWorker, NULL, 0, RTTHREADTYPE_IO, RTTHREADFLAGS_WAITABLE,
    1055                                     "USBTSTSRV");
     1054                rc = RTPipeCreate(&g_hPipeR, &g_hPipeW, 0);
    10561055                if (RT_SUCCESS(rc))
    1057                     return VINF_SUCCESS;
     1056                {
     1057                    /* Spin off the thread serving connections. */
     1058                    rc = RTThreadCreate(&g_hThreadServing, utsClientWorker, NULL, 0, RTTHREADTYPE_IO, RTTHREADFLAGS_WAITABLE,
     1059                                        "USBTSTSRV");
     1060                    if (RT_SUCCESS(rc))
     1061                        return VINF_SUCCESS;
     1062                    else
     1063                        RTMsgError("Creating the client worker thread failed with %Rrc\n", rc);
     1064
     1065                    RTPipeClose(g_hPipeR);
     1066                    RTPipeClose(g_hPipeW);
     1067                }
    10581068                else
    1059                     RTMsgError("Creating the client worker thread failed with %Rrc\n", rc);
    1060 
    1061                 RTPipeClose(g_hPipeR);
    1062                 RTPipeClose(g_hPipeW);
     1069                    RTMsgError("Creating communications pipe failed with %Rrc\n", rc);
     1070
     1071                RTCritSectDelete(&g_CritSectClients);
    10631072            }
    10641073            else
    1065                 RTMsgError("Creating communications pipe failed with %Rrc\n", rc);
    1066 
    1067             RTCritSectDelete(&g_CritSectClients);
     1074                RTMsgError("Creating global critical section failed with %Rrc\n", rc);
     1075
     1076            utsConfigAstDestroy(g_pCfgAst);
    10681077        }
    10691078        else
    1070             RTMsgError("Creating global critical section failed with %Rrc\n", rc);
    1071 
    1072         utsConfigAstDestroy(g_pCfgAst);
    1073     }
    1074     else
    1075     {
    1076         if (RTErrInfoIsSet(pErrInfo))
    10771079        {
    1078             RTMsgError("Failed to parse config with detailed error: %s (%Rrc)\n",
    1079                        pErrInfo->pszMsg, pErrInfo->rc);
    1080             RTErrInfoFree(pErrInfo);
     1080            if (RTErrInfoIsSet(pErrInfo))
     1081            {
     1082                RTMsgError("Failed to parse config with detailed error: %s (%Rrc)\n",
     1083                           pErrInfo->pszMsg, pErrInfo->rc);
     1084                RTErrInfoFree(pErrInfo);
     1085            }
     1086            else
     1087                RTMsgError("Faield to parse config with unknown error (%Rrc)\n", rc);
     1088            return rc;
    10811089        }
    1082         else
    1083             RTMsgError("Faield to parse config with unknown error (%Rrc)\n", rc);
    1084         return rc;
    10851090    }
    10861091
     
    14251430    g_pTransport->pfnTerm();
    14261431
     1432    utsPlatformTerm();
     1433
    14271434    return rcExit;
    14281435}
Note: See TracChangeset for help on using the changeset viewer.

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