VirtualBox

Changeset 34128 in vbox for trunk


Ignore:
Timestamp:
Nov 16, 2010 5:28:34 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
67840
Message:

mp-freebsd.cpp: r=bird: RTStrPrintf does not return an IPRT status code. Unnecessary variable initialization is confusing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/freebsd/mp-freebsd.cpp

    r33815 r34128  
    8484RTDECL(bool) RTMpIsCpuOnline(RTCPUID idCpu)
    8585{
    86     int rc = VINF_SUCCESS;
    87     char szName[32];
    88     char szDriver[10];
    89     size_t cbDriver = sizeof(szDriver);
    90 
    9186    /*
    92      * FreeBSD doesn't support CPU hotplugging
    93      * so every CPU which appears in the tree is also online.
     87     * FreeBSD doesn't support CPU hotplugging so every CPU which appears
     88     * in the tree is also online.
    9489     */
    95     memset(szDriver, 0, sizeof(szDriver));
    96     memset(szName, 0, sizeof(szName));
    97 
    98     rc = RTStrPrintf(szName, sizeof(szName), "dev.cpu.%d.%%driver", (int)idCpu);
    99     if (RT_SUCCESS(rc))
    100     {
    101         int rcBsd = sysctlbyname(szName, szDriver, &cbDriver, NULL, NULL);
    102         if (rcBsd == 0)
    103             return true;
    104     }
     90    char    szName[40];
     91    RTStrPrintf(szName, sizeof(szName), "dev.cpu.%d.%%driver", (int)idCpu);
     92
     93    char    szDriver[10];
     94    size_t  cbDriver = sizeof(szDriver);
     95    RT_ZERO(szDevice);                  /* this shouldn't be necessary. */
     96    int rcBsd = sysctlbyname(szName, szDriver, &cbDriver, NULL, NULL);
     97    if (rcBsd == 0)
     98        return true;
    10599
    106100    return false;
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