VirtualBox

Changeset 65200 in vbox for trunk/src/VBox/Additions/linux


Ignore:
Timestamp:
Jan 9, 2017 12:00:15 PM (8 years ago)
Author:
vboxsync
Message:

Additions/linux/sharedfolders: corrected open flags translation for O_TRUNC

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/sharedfolders/regops.c

    r62527 r65200  
    329329        {
    330330            LogFunc(("O_TRUNC set\n"));
    331             params.CreateFlags |= (  SHFL_CF_ACT_OVERWRITE_IF_EXISTS
    332                                    | SHFL_CF_ACCESS_WRITE);
     331            params.CreateFlags |= SHFL_CF_ACT_OVERWRITE_IF_EXISTS;
    333332        }
    334333        else
     
    341340        {
    342341            LogFunc(("O_TRUNC set\n"));
    343             params.CreateFlags |= (  SHFL_CF_ACT_OVERWRITE_IF_EXISTS
    344                     | SHFL_CF_ACCESS_WRITE);
     342            params.CreateFlags |= SHFL_CF_ACT_OVERWRITE_IF_EXISTS;
    345343        }
    346344    }
    347345
    348     if (!(params.CreateFlags & SHFL_CF_ACCESS_READWRITE))
    349     {
    350         switch (file->f_flags & O_ACCMODE)
    351         {
    352             case O_RDONLY:
    353                 params.CreateFlags |= SHFL_CF_ACCESS_READ;
    354                 break;
    355 
    356             case O_WRONLY:
    357                 params.CreateFlags |= SHFL_CF_ACCESS_WRITE;
    358                 break;
    359 
    360             case O_RDWR:
    361                 params.CreateFlags |= SHFL_CF_ACCESS_READWRITE;
    362                 break;
    363 
    364             default:
    365                 BUG ();
    366         }
     346    switch (file->f_flags & O_ACCMODE)
     347    {
     348        case O_RDONLY:
     349            params.CreateFlags |= SHFL_CF_ACCESS_READ;
     350            break;
     351
     352        case O_WRONLY:
     353            params.CreateFlags |= SHFL_CF_ACCESS_WRITE;
     354            break;
     355
     356        case O_RDWR:
     357            params.CreateFlags |= SHFL_CF_ACCESS_READWRITE;
     358            break;
     359
     360        default:
     361            BUG ();
    367362    }
    368363
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