VirtualBox

Ignore:
Timestamp:
Oct 4, 2012 1:04:59 PM (12 years ago)
Author:
vboxsync
Message:

Main/Metrics: Speed may not fit into uint32_t fixed (#6345)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/solaris/NetIf-solaris.cpp

    r43538 r43541  
    5151#include "DynLoadLibSolaris.h"
    5252
    53 static uint64 kstatGet(const char *pszMask)
     53static uint64_t kstatGet(const char *pszMask)
    5454{
    5555    char szBuf[RTPATH_MAX];
     
    107107    char szMask[RTPATH_MAX];
    108108    RTStrPrintf(szMask, sizeof(szMask), "*:*:%s:ifspeed", pInfo->szShortName);
    109     pInfo->uSpeedMbits = kstatGet(szMask);
    110     if (pInfo->uSpeedMbits == 0)
     109    uint64_t uSpeed = kstatGet(szMask);
     110    if (uSpeed == 0)
    111111    {
    112112        Log(("queryIfaceSpeed: failed to get speed for %s via kstat(%s)\n", pInfo->szShortName, szMask));
     
    116116        RTStrPrintf(szMask, sizeof(szMask), "%s:%u:*:ifspeed",
    117117                    szDevName, uInstance);
    118         pInfo->uSpeedMbits = kstatGet(szMask);
    119         if (pInfo->uSpeedMbits == 0)
     118        uSpeed = kstatGet(szMask);
     119        if (uSpeed == 0)
    120120            LogRel(("queryIfaceSpeed: failed to get speed for %s(instance=%u) via kstat\n", szDevName, uInstance));
    121121    }
    122     pInfo->uSpeedMbits /= 1000000; /* bits -> Mbits */
     122    pInfo->uSpeedMbits = uSpeed / 1000000; /* bits -> Mbits */
    123123}
    124124
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