~ubuntu-branches/ubuntu/precise/virtualbox/precise-updates

« back to all changes in this revision

Viewing changes to src/VBox/Main/src-server/VirtualBoxImpl.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2011-10-17 23:23:09 UTC
  • mfrom: (3.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20111017232309-kzm6841lzk61ranj
Tags: 4.1.4-dfsg-1
* New upstream release.
  - Fixes missing icons when using pt_BR locale. (Closes: #507188)
  - Fixes guest additions download url. (Closes: #637349; LP: #840668)
* Refresh patches.
* Drop the vboxmouse x11 driver. The mouse integration is now completely
  handled by the kernel module.
* Restrict dh_pycentral to the virtualbox binary package.
* Merge changes from the Ubuntu package but use them only when built
  on Ubuntu:
  - Add an Apport hook.
  - Add vboxguest modalias to the package control field.
* Pass KBUILD_VERBOSE=2 to kmk.
* Add 36-fix-text-mode.patch to fix text mode when using the vboxvideo driver.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: VirtualBoxImpl.cpp 38211 2011-07-28 09:26:31Z vboxsync $ */
 
1
/* $Id: VirtualBoxImpl.cpp $ */
2
2
 
3
3
/** @file
4
4
 * Implementation of IVirtualBox in VBoxSVC.
3931
3931
}
3932
3932
 
3933
3933
/**
3934
 
 * Creates the path to the specified file according to the path information
3935
 
 * present in the file name.
 
3934
 * Checks if the path to the specified file exists, according to the path
 
3935
 * information present in the file name. Optionally the path is created.
3936
3936
 *
3937
3937
 * Note that the given file name must contain the full path otherwise the
3938
3938
 * extracted relative path will be created based on the current working
3939
3939
 * directory which is normally unknown.
3940
3940
 *
3941
 
 * @param aFileName     Full file name which path needs to be created.
 
3941
 * @param aFileName     Full file name which path is checked/created.
 
3942
 * @param aCreate       Flag if the path should be created if it doesn't exist.
3942
3943
 *
3943
 
 * @return Extended error information on failure to create the path.
 
3944
 * @return Extended error information on failure to check/create the path.
3944
3945
 */
3945
3946
/* static */
3946
 
HRESULT VirtualBox::ensureFilePathExists(const Utf8Str &strFileName)
 
3947
HRESULT VirtualBox::ensureFilePathExists(const Utf8Str &strFileName, bool fCreate)
3947
3948
{
3948
3949
    Utf8Str strDir(strFileName);
3949
3950
    strDir.stripFilename();
3950
3951
    if (!RTDirExists(strDir.c_str()))
3951
3952
    {
3952
 
        int vrc = RTDirCreateFullPath(strDir.c_str(), 0777);
3953
 
        if (RT_FAILURE(vrc))
3954
 
            return setErrorStatic(E_FAIL,
3955
 
                                  Utf8StrFmt(tr("Could not create the directory '%s' (%Rrc)"),
3956
 
                                             strDir.c_str(),
3957
 
                                             vrc));
 
3953
        if (fCreate)
 
3954
        {
 
3955
            int vrc = RTDirCreateFullPath(strDir.c_str(), 0777);
 
3956
            if (RT_FAILURE(vrc))
 
3957
                return setErrorStatic(VBOX_E_IPRT_ERROR,
 
3958
                                      Utf8StrFmt(tr("Could not create the directory '%s' (%Rrc)"),
 
3959
                                                 strDir.c_str(),
 
3960
                                                 vrc));
 
3961
        }
 
3962
        else
 
3963
            return setErrorStatic(VBOX_E_IPRT_ERROR,
 
3964
                                  Utf8StrFmt(tr("Directory '%s' does not exist"),
 
3965
                                             strDir.c_str()));
3958
3966
    }
3959
3967
 
3960
3968
    return S_OK;
4538
4546
    // signal that we're ready
4539
4547
    RTThreadUserSignal(thread);
4540
4548
 
4541
 
    while (RT_SUCCESS(eventQ->processEventQueue(RT_INDEFINITE_WAIT)))
 
4549
    /*
 
4550
     * In case of spurious wakeups causing VERR_TIMEOUTs and/or other return codes
 
4551
     * we must not stop processing events and delete the "eventQ" object. This must
 
4552
     * be done ONLY when we stop this loop via interruptEventQueueProcessing().
 
4553
     * See #5724.
 
4554
     */
 
4555
    while (eventQ->processEventQueue(RT_INDEFINITE_WAIT) != VERR_INTERRUPTED)
4542
4556
        /* nothing */ ;
4543
4557
 
4544
4558
    delete eventQ;