~ubuntu-branches/ubuntu/vivid/virtualbox-ose/vivid

« back to all changes in this revision

Viewing changes to src/VBox/HostDrivers/Support/solaris/SUPLib-solaris.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2010-03-11 17:16:37 UTC
  • mfrom: (0.3.4 upstream) (0.4.8 sid)
  • Revision ID: james.westby@ubuntu.com-20100311171637-43z64ia3ccpj8vqn
Tags: 3.1.4-dfsg-2ubuntu1
* Merge from Debian unstable (LP: #528561), remaining changes:
  - VirtualBox should go in Accessories, not in System tools (LP: #288590)
    - debian/virtualbox-ose-qt.files/virtualbox-ose.desktop
  - Add Apport hook
    - debian/virtualbox-ose.files/source_virtualbox-ose.py
    - debian/virtualbox-ose.install
  - Add Launchpad integration
    - debian/control
    - debian/lpi-bug.xpm
    - debian/patches/u02-lp-integration.dpatch
  - Replace *-source packages with transitional packages for *-dkms
* Fix crash in vboxvideo_drm with kernel 2.6.33 / backported drm code
  (LP: #535297)
* Add a list of linux-headers packages to the apport hook
* Update debian/patches/u02-lp-integration.dpatch with a
  DEP-3 compliant header
* Add ${misc:Depends} to virtualbox-ose-source and virtualbox-ose-guest-source
  Depends

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
    if (fPreInited)
82
82
        return VINF_SUCCESS;
83
83
 
 
84
    /*
 
85
     * Open dummy files to preallocate file descriptors, see #4650.
 
86
     */
 
87
    for (int i = 0; i < SUPLIB_FLT_DUMMYFILES; i++)
 
88
    {
 
89
        pThis->hDummy[i] = -1;
 
90
        int hDummy = open("/dev/null", O_RDWR, 0);
 
91
        if (hDummy >= 0)
 
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
        }
 
101
        else
 
102
            LogRel(("Failed to open[%d] /dev/null! errno=%d\n", i, errno));
 
103
    }
84
104
 
85
105
    /*
86
106
     * Try to open the device.
127
147
int suplibOsTerm(PSUPLIBDATA pThis)
128
148
{
129
149
    /*
 
150
     * Close the dummy files first.
 
151
     */
 
152
    for (int i = 0; i < SUPLIB_FLT_DUMMYFILES; i++)
 
153
    {
 
154
        if (pThis->hDummy[i] != -1)
 
155
        {
 
156
            close(pThis->hDummy[i]);
 
157
            pThis->hDummy[i] = -1;
 
158
        }
 
159
    }
 
160
 
 
161
    /*
130
162
     * Check if we're initialized
131
163
     */
132
164
    if (pThis->hDevice != NIL_RTFILE)