VirtualBox

Changeset 49598 in vbox for trunk/src


Ignore:
Timestamp:
Nov 21, 2013 10:36:22 AM (11 years ago)
Author:
vboxsync
Message:

warnings in normally disabled legacy code

Location:
trunk/src/VBox
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/DrvTAP.cpp

    r46035 r49598  
    651651        LogRel(("TAP#%d: Failed to get interface flags after setting PPA. errno=%d\n", pThis->pDrvIns->iInstance, errno));
    652652
    653 #ifdef VBOX_SOLARIS_TAP_ARP
     653# ifdef VBOX_SOLARIS_TAP_ARP
    654654    /* Interface */
    655655    if (ioctl(InterfaceFD, I_PUSH, "arp") == -1)
     
    677677    if (ioctl(ARPFileDes, I_STR, &ioIF) == -1)
    678678        LogRel(("TAP#%d: Failed to set interface name to ARP.\n", pThis->pDrvIns->iInstance));
    679 #endif
     679# endif
    680680
    681681    /* We must use I_LINK and not I_PLINK as I_PLINK makes the link persistent.
     
    687687    {
    688688        close(InterfaceFD);
    689 #ifdef VBOX_SOLARIS_TAP_ARP
     689# ifdef VBOX_SOLARIS_TAP_ARP
    690690        close(ARPFileDes);
    691 #endif
     691# endif
    692692        LogRel(("TAP#%d: Cannot link TAP device to IP.\n", pThis->pDrvIns->iInstance));
    693693        return PDMDrvHlpVMSetError(pThis->pDrvIns, VERR_HOSTIF_IOCTL, RT_SRC_POS,
     
    695695    }
    696696
    697 #ifdef VBOX_SOLARIS_TAP_ARP
     697# ifdef VBOX_SOLARIS_TAP_ARP
    698698    int ARPMuxID = ioctl(IPFileDes, I_LINK, ARPFileDes);
    699699    if (ARPMuxID == -1)
     
    701701
    702702    close(ARPFileDes);
    703 #endif
     703# endif
    704704    close(InterfaceFD);
    705705
     
    708708    RTStrCopy(ifReq.lifr_name, sizeof(ifReq.lifr_name), pThis->pszDeviceName);
    709709    ifReq.lifr_ip_muxid  = IPMuxID;
    710 #ifdef VBOX_SOLARIS_TAP_ARP
     710# ifdef VBOX_SOLARIS_TAP_ARP
    711711    ifReq.lifr_arp_muxid = ARPMuxID;
    712 #endif
     712# endif
    713713
    714714    if (ioctl(IPFileDes, SIOCSLIFMUXID, &ifReq) == -1)
    715715    {
    716 #ifdef VBOX_SOLARIS_TAP_ARP
     716# ifdef VBOX_SOLARIS_TAP_ARP
    717717        ioctl(IPFileDes, I_PUNLINK, ARPMuxID);
    718 #endif
     718# endif
    719719        ioctl(IPFileDes, I_PUNLINK, IPMuxID);
    720720        close(IPFileDes);
     
    726726    int rc = RTFileFromNative(&pThis->hFileDevice, TapFileDes);
    727727    AssertLogRelRC(rc);
    728     if (RT_FAILURE(rc)))
     728    if (RT_FAILURE(rc))
    729729    {
    730730        close(IPFileDes);
     
    978978                                   N_("Configuration error: Failed to configure /dev/net/tun. errno=%d"), errno);
    979979    /** @todo determine device name. This can be done by reading the link /proc/<pid>/fd/<fd> */
    980     Log(("drvTAPContruct: %d (from fd)\n", pThis->hFileDevice));
     980    Log(("drvTAPContruct: %d (from fd)\n", (intptr_t)pThis->hFileDevice));
    981981    rc = VINF_SUCCESS;
    982982
  • trunk/src/VBox/Main/src-client/ConsoleImpl.cpp

    r49471 r49598  
    84878487            RTStrCopy(IfReq.ifr_name, sizeof(IfReq.ifr_name), str.c_str()); /** @todo bitch about names which are too long... */
    84888488            IfReq.ifr_flags = IFF_TAP | IFF_NO_PI;
    8489             rcVBox = ioctl(maTapFD[slot], TUNSETIFF, &IfReq);
     8489            rcVBox = ioctl(RTFileToNative(maTapFD[slot]), TUNSETIFF, &IfReq);
    84908490            if (rcVBox != 0)
    84918491            {
     
    85018501             * Make it pollable.
    85028502             */
    8503             if (fcntl(maTapFD[slot], F_SETFL, O_NONBLOCK) != -1)
     8503            if (fcntl(RTFileToNative(maTapFD[slot]), F_SETFL, O_NONBLOCK) != -1)
    85048504            {
    85058505                Log(("attachToTapInterface: %RTfile %ls\n", maTapFD[slot], tapDeviceName.raw()));
  • trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp

    r49588 r49598  
    43724372                }
    43734373
    4374                 Assert((int)maTapFD[uInstance] >= 0);
    4375                 if ((int)maTapFD[uInstance] >= 0)
     4374                Assert((intptr_t)maTapFD[uInstance] >= 0);
     4375                if ((intptr_t)maTapFD[uInstance] >= 0)
    43764376                {
    43774377                    InsertConfigString(pLunL0, "Driver", "HostInterface");
    43784378                    InsertConfigNode(pLunL0, "Config", &pCfg);
    4379                     InsertConfigInteger(pCfg, "FileHandle", maTapFD[uInstance]);
     4379                    InsertConfigInteger(pCfg, "FileHandle", (intptr_t)maTapFD[uInstance]);
    43804380                }
    43814381
     
    45714571                    }
    45724572
    4573                     Assert((int)maTapFD[uInstance] >= 0);
    4574                     if ((int)maTapFD[uInstance] >= 0)
     4573                    Assert((intptr_t)maTapFD[uInstance] >= 0);
     4574                    if ((intptr_t)maTapFD[uInstance] >= 0)
    45754575                    {
    45764576                        InsertConfigString(pLunL0, "Driver", "HostInterface");
    45774577                        InsertConfigNode(pLunL0, "Config", &pCfg);
    4578                         InsertConfigInteger(pCfg, "FileHandle", maTapFD[uInstance]);
     4578                        InsertConfigInteger(pCfg, "FileHandle", (intptr_t)maTapFD[uInstance]);
    45794579                    }
    45804580                    break;
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