VirtualBox

Changeset 6831 in vbox


Ignore:
Timestamp:
Feb 6, 2008 3:16:36 PM (17 years ago)
Author:
vboxsync
Message:

First bugfix for shared folder guest -> host copying. Now overwriting of files works again (was broken in former builds).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedFolders/vbsf.cpp

    r6415 r6831  
    631631    /* Open or create a file. */
    632632    unsigned fOpen = 0;
     633        bool fNoError = false;
     634
    633635    int rc = vbsfConvertFileOpenFlags(pParms->CreateFlags, &fOpen);
    634636    if (RT_SUCCESS(rc))
     
    664666            }
    665667            pParms->Result = SHFL_FILE_EXISTS;
     668
     669                        /* This actually isn't an error, because the file simply already exists,
     670                           so correct the rc before return later, to make the driver (VBoxSF.sys) happy. */
     671                        fNoError = true;       
    666672            break;
    667673        default:
     
    669675        }
    670676    }
     677
    671678    if (RT_SUCCESS(rc))
    672679    {
     
    738745        pParms->Handle = handle;
    739746    }
     747
     748        /* Report the driver that all is okay, we're done here */
     749        if (fNoError)
     750                rc = VINF_SUCCESS;
     751
    740752    LogFlow(("vbsfOpenFile: rc = %Vrc\n", rc));
    741753    return rc;
     
    797809        }
    798810        if (   RT_SUCCESS(rc)
    799             || (   SHFL_CF_ACT_OPEN_IF_EXISTS
    800                 == BIT_FLAG(pParms->CreateFlags, SHFL_CF_ACT_MASK_IF_EXISTS)))
     811            || (SHFL_CF_ACT_OPEN_IF_EXISTS == BIT_FLAG(pParms->CreateFlags, SHFL_CF_ACT_MASK_IF_EXISTS))
     812                        || (SHFL_FILE_EXISTS == pParms->Result))        /* Call of RTDirCreate() avbove failed, because already existing? */
    801813        {
    802814            /* Open the directory now */
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