VirtualBox

Changeset 26381 in vbox


Ignore:
Timestamp:
Feb 9, 2010 2:47:15 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
57474
Message:

Solaris/SUPLib: enabled fix for #4650 (fix fd table from growing on vboxflt close)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/solaris/SUPLib-solaris.cpp

    r26362 r26381  
    8282        return VINF_SUCCESS;
    8383
    84 #ifdef VBOXFLT_DUMMYFILES
    8584    /*
    8685     * Open dummy files to preallocate file descriptors, see #4650.
    8786     */
    88     for (int i = 0; i < VBOXFLT_DUMMYFILES; i++)
    89     {
     87    for (int i = 0; i < SUPLIB_FLT_DUMMYFILES; i++)
     88    {
     89        pThis->hDummy[i] = -1;
    9090        int hDummy = open("/dev/null", O_RDWR, 0);
    91         fcntl(hDummy, F_SETFD, FD_CLOEXEC);
    9291        if (hDummy >= 0)
    93             pThis->hDummy[i] = hDummy;
     92        {
     93            if (fcntl(hDummy, F_SETFD, FD_CLOEXEC) == 0)
     94                pThis->hDummy[i] = hDummy;
     95            else
     96            {
     97                close(hDummy);
     98                LogRel(("Failed to set close on exec [%d] /dev/null! errno=%d\n", i, errno));
     99            }
     100        }
    94101        else
    95         {
    96             pThis->hDummy[i] = -1;
    97102            LogRel(("Failed to open[%d] /dev/null! errno=%d\n", i, errno));
    98         }
    99     }
    100 #endif
     103    }
    101104
    102105    /*
     
    144147int suplibOsTerm(PSUPLIBDATA pThis)
    145148{
    146 #ifdef VBOXFLT_DUMMYFILES
    147149    /*
    148150     * Close the dummy files first.
    149151     */
    150     for (int i = 0; i < VBOXFLT_DUMMYFILES; i++)
     152    for (int i = 0; i < SUPLIB_FLT_DUMMYFILES; i++)
    151153    {
    152154        if (pThis->hDummy[i] != -1)
     
    156158        }
    157159    }
    158 #endif
    159160
    160161    /*
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