VirtualBox

Ignore:
Timestamp:
Apr 21, 2010 8:59:36 AM (15 years ago)
Author:
vboxsync
Message:

code cleanup

File:
1 edited

Legend:

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

    r28548 r28550  
    175175    if (RT_SUCCESS(rc))
    176176    {
    177         /* Write information to host. */
    178         rc = VBoxServiceWritePropF(g_VMInfoGuestPropSvcClientID, "/VirtualBox/GuestAdd/Version",  "%s", pszAddVer);
    179         rc = VBoxServiceWritePropF(g_VMInfoGuestPropSvcClientID, "/VirtualBox/GuestAdd/Revision", "%s", pszAddRev);
     177        VBoxServiceWritePropF(g_VMInfoGuestPropSvcClientID, "/VirtualBox/GuestAdd/Version",  "%s", pszAddVer);
     178        VBoxServiceWritePropF(g_VMInfoGuestPropSvcClientID, "/VirtualBox/GuestAdd/Revision", "%s", pszAddRev);
    180179        RTStrFree(pszAddVer);
    181180        RTStrFree(pszAddRev);
    182181    }
    183     else /* If not found delete stale entries. */
    184     {
    185         rc = VBoxServiceWritePropF(g_VMInfoGuestPropSvcClientID, "/VirtualBox/GuestAdd/Version", NULL);
    186         rc = VBoxServiceWritePropF(g_VMInfoGuestPropSvcClientID, "/VirtualBox/GuestAdd/Revision", NULL);
     182    else
     183    {
     184        /* information could not be retrieved, clear stale entries */
     185        VBoxServiceWritePropF(g_VMInfoGuestPropSvcClientID, "/VirtualBox/GuestAdd/Version", "");
     186        VBoxServiceWritePropF(g_VMInfoGuestPropSvcClientID, "/VirtualBox/GuestAdd/Revision", "");
    187187    }
    188188
     
    195195    if (RT_SUCCESS(rc))
    196196    {
    197         rc = VBoxServiceWritePropF(g_VMInfoGuestPropSvcClientID, "/VirtualBox/GuestAdd/InstallDir", "%s", pszInstDir);
     197        VBoxServiceWritePropF(g_VMInfoGuestPropSvcClientID, "/VirtualBox/GuestAdd/InstallDir", "%s", pszInstDir);
    198198        RTStrFree(pszInstDir);
    199199    }
    200     else /* If not found delete stale entry. */
    201     {
    202         rc = VBoxServiceWritePropF(g_VMInfoGuestPropSvcClientID, "/VirtualBox/GuestAdd/InstallDir", NULL);
    203     }
     200    else
     201        /* information could not be retrieved, clear stale entry */
     202        VBoxServiceWritePropF(g_VMInfoGuestPropSvcClientID, "/VirtualBox/GuestAdd/InstallDir", "");
     203
    204204    VBoxServiceWinGetComponentVersions(g_VMInfoGuestPropSvcClientID);
    205205#endif
    206 
    207     /* return rc; */
    208206}
    209207
     
    224222    WSADATA wsaData;
    225223    if (WSAStartup(MAKEWORD(2, 2), &wsaData))
    226          VBoxServiceError("WSAStartup failed! Error: %Rrc\n", RTErrConvertFromWin32(WSAGetLastError()));
     224        VBoxServiceError("WSAStartup failed! Error: %Rrc\n", RTErrConvertFromWin32(WSAGetLastError()));
    227225#endif /* RT_OS_WINDOWS */
    228226
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