VirtualBox

Changeset 59686 in vbox for trunk/src/VBox/Devices/USB


Ignore:
Timestamp:
Feb 15, 2016 5:01:24 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
105543
Message:

VUSBSniffer: Add flag to avoid overwriting exitisting captures, compiler warnings

Location:
trunk/src/VBox/Devices/USB
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/USB/VUSBSniffer.cpp

    r59633 r59686  
    159159        if (RT_SUCCESS(rc))
    160160        {
    161             rc = RTFileOpen(&pThis->hFile, pszCaptureFilename, RTFILE_O_DENY_NONE | RTFILE_O_CREATE_REPLACE | RTFILE_O_WRITE | RTFILE_O_READ);
     161            uint32_t fFileFlags = RTFILE_O_DENY_NONE | RTFILE_O_WRITE | RTFILE_O_READ;
     162            if (fFlags & VUSBSNIFFER_F_NO_REPLACE)
     163                fFileFlags |= RTFILE_O_CREATE;
     164            else
     165                fFileFlags |= RTFILE_O_CREATE_REPLACE;
     166
     167            rc = RTFileOpen(&pThis->hFile, pszCaptureFilename, fFileFlags);
    162168            if (RT_SUCCESS(rc))
    163169            {
  • trunk/src/VBox/Devices/USB/VUSBSniffer.h

    r59615 r59686  
    5252} VUSBSNIFFEREVENT;
    5353
     54/** VUSB Sniffer creation flags.
     55 * @{ */
     56/** Default flags. */
     57#define VUSBSNIFFER_F_DEFAULT    0
     58/** Don't overwrite any existing capture file. */
     59#define VUSBSNIFFER_F_NO_REPLACE RT_BIT_32(0)
     60/** @} */
     61
    5462/**
    5563 * Create a new VUSB sniffer instance dumping to the given capture file.
     
    5765 * @returns VBox status code.
    5866 * @param   phSniffer             Where to store the handle to the sniffer instance on success.
    59  * @param   fFlags                Flags, reserved, must be 0.
     67 * @param   fFlags                Flags, combination of VUSBSNIFFER_F_*
    6068 * @param   pszCaptureFilename    The filename to use for capturing the sniffed data.
    6169 * @param   pszFmt                The format of the dump, NULL to select one based on the filename
  • trunk/src/VBox/Devices/USB/VUSBSnifferUsbMon.cpp

    r59633 r59686  
    8888{
    8989    char aszLineBuf[512];
    90     char chEvtType;
    91     char chDir;
    92     char chEptType;
     90    char chEvtType = 'X';
     91    char chDir = 'X';
     92    char chEptType = 'X';
    9393
    9494    switch (enmEvent)
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