Permalink
Commits on Jan 18, 2017
  1. misc: update active developers list

    * Removing myself, since I am no longer involved in libusb
    pbatard committed Jan 18, 2017
Commits on Jan 12, 2017
  1. Windows: Remove unused safe_* macro definitions

    Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
    dickens committed Jan 12, 2017
  2. Windows: Slightly optimize the sanitize_path() function

    Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
    dickens committed Jan 12, 2017
  3. Windows: Switch to snprintf() in windows_get_version()

    Also remove "Windows" from the constructed string since that will
    always be there and just complicates the logic.
    
    Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
    dickens committed Jan 12, 2017
  4. Windows: Fix memory and handle leaks in winusbx_claim_interface()

    When using the libusb0 filter driver, the loop could potentially leak the
    memory for dev_interface_details. In that same loop, if the dev path
    without the GUID matches the interface path, the new file handle would
    be leaked.
    
    Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
    dickens committed Jan 12, 2017
  5. Windows: Fix some minor styling issues

    Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
    dickens committed Jan 12, 2017
  6. Windows: Clean up unnecessary variable initialization

    Don't zero out variables that already are zero (calloc'ed) and
    don't set variables that aren't read before being set again.
    
    Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
    dickens committed Jan 12, 2017
  7. Windows/WinCE: Remove uses of safe_* macros where not useful

    Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
    dickens committed Jan 12, 2017
  8. Windows/WinCE: Improvements to windows_error_str() function

    1) Add FORMAT_MESSAGE_IGNORE_INSERTS to flags for security.
    2) Optimize removal of CR/LF terminators
    3) Switch to use snprintf()
    
    Windows-specific:
      1) Don't waste time converting debug messages to unicode
    
    WinCE-specific:
      1) Get rid of TCHAR code
    
    Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
    dickens committed Jan 12, 2017
  9. Windows: Provide C99 compliant implementations of (v)snprintf()

    The Microsoft implementations of _snprintf() and vsnprintf() do not
    guarantee that the output buffer is NULL-terminated, and they do not
    return the number of bytes that *would* have been written if truncation
    were to occur. This commit adds implementations that do just that.
    
    Note that VS2015 and above provide C99 compliant versions of these
    functions, so those will be used when available.
    
    Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
    dickens committed Jan 12, 2017
  10. Windows: Hash table improvements

    1) The current implementation was not entirely thread-safe. The hash
       table was read outside of the mutex, which in some cases could lead
       to improper hashing.
    2) The hash creation function accepted a size parameter that was
       hard-coded. Eliminating this saves time because we can ensure that
       the pre-defined size is a prime number instead of requiring code to
       calculate a prime number.
    
    Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
    dickens committed Jan 12, 2017
  11. configure.ac: Clean up style

    For consistency, only use quotes for strings where variables are
    interpolated.
    
    Also make the check for syslog capability dependent upon whether system
    logging has been enabled.
    
    Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
    dickens committed Jan 12, 2017
  12. core: Remove use of gettimeofday()

    Prior to this commit, gettimeofday() was being used for timestamps
    in debug messages. This function has been marked as deprecated in
    the latest POSIX specification and furthermore is not supported on
    Windows, thus requiring our own implementation as usbi_gettimeofday().
    
    This commit changes the logging code to obtain timestamps using the
    clock_gettime() function provided by the backend. The implementation of
    usbi_gettimeofday() for Windows was actually equivalent to that of the
    USBI_CLOCK_REALTIME implementation for clock_gettime(), so this
    eliminates code duplication. In addition, the USBI_CLOCK_REALTIME
    implementation has been updated for Windows to leverage the
    timespec_get() function available in VS 2015 and later.
    
    Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
    dickens committed Jan 12, 2017
  13. core: Remove check for and inclusion of signal.h

    Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
    dickens committed Jan 12, 2017
  14. Windows: Fix DDK build's missing files

    Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
    dickens committed Jan 9, 2017
Commits on Jan 6, 2017
  1. Windows: Add Visual Studio 2017 support

    Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
    dickens committed Jan 6, 2017
Commits on Jan 4, 2017
  1. travis: remove -fdiagnostics-color=auto

    -fdiagnostics-color=auto is not supported bug gcc version 4.8.4
    gcc: error: unrecognized command line option '-fdiagnostics-color=auto'
    LudovicRousseau committed Jan 4, 2017
  2. travis: remove -Werror

    Using -Werror in CFLAGS make ./configure to fails with:
     checking whether the C compiler works... no
     configure: error: in `/home/travis/build/LudovicRousseau/libusb':
     configure: error: C compiler cannot create executables
     See `config.log' for more details
    
    -Werror had no effect because CFLAGS was _not_ exported.
    LudovicRousseau committed Jan 4, 2017
  3. travis: use bash for travis-autogen.sh

    Problem was:
    ./travis-autogen.sh: 6: ./travis-autogen.sh: CFLAGS+= -Wbad-function-cast: not found
    ./travis-autogen.sh: 8: ./travis-autogen.sh: CFLAGS+= -Wchar-subscripts: not found
    [...]
    LudovicRousseau committed Jan 4, 2017
  4. travis: do not use parallel compilations

    The goal is not to be fast but to get a clean log with not mixed
    messages between 2 compilations executed at the same time.
    LudovicRousseau committed Jan 4, 2017
  5. travis: make clean before building

    Call "make clean" to be sure the compilation will be done even if some
    files were already compiled.
    
    The problem was that the travis script does a double ./configure + build
    on Linux. The second build just did nothing since the files were already
    compiled.
    LudovicRousseau committed Jan 4, 2017
  6. darwin: Replace bzero() with memset()

    The bzero() function is a deprecated BSD function that can be replaced
    by the standard C90 memset() function.
    
    From memset(4) manpage:
      The memset() function conforms to ISO/IEC 9899:1990 (``ISO C90'').
    
    From bzero(3) manpage:
      bzero() was deprecated in IEEE Std 1003.1-2001 (``POSIX.1'') and removed
      in IEEE Std 1003.1-2008 (``POSIX.1'').
    
    When compiling for POSIX 2008, the bzero() function is undefined on the
    OS X platform.
    vianney committed with LudovicRousseau Apr 11, 2016
  7. Misc: Fix a Doxygen comment typo

    mojocorp committed with LudovicRousseau Jan 3, 2017
Commits on Nov 28, 2016
  1. linux_get_parent_info: Check for NULL priv->sysfs_dir before strcmp

    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    staples1347 committed with jwrdegoede Nov 30, 2015
  2. Fix a race condition with libusb_interrupt_event_handler().

    USBI_EVENT_USER_INTERRUPT isn't set in case of another pending event. When
    libusb_interrupt_event_handler() is called and USBI_EVENT_POLLFDS_MODIFIED is
    already set, but libusb_handle_events() isn't currently active waiting in
    poll(), the interrupt request will be cleared before poll() is called. poll()
    therefore blocks and the event handler doesn't return.
    
    This is especially the case, when libusb_interrupt_event_handler() is called
    before the first call to libusb_handle_events(). In this case
    libusb_handle_events() blocks instead of returning immediately.
    
    This patch fixes the race condition by setting the event flag the same way a
    usbi_fd_notification().
    
    Signed-off-by: Lars Kanis <lars@greiz-reinsdorf.de>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    larskanis committed with jwrdegoede Nov 27, 2016
Commits on Nov 3, 2016
  1. linux_udev: Retry poll() on EINTR

    The poll() syscall may temporarily fail when it is interrupted by a
    signal; -1 is returned and errno is set to EINTR.
    
    When this occurred, the udev event thread exited.
    
    Instead, since this is a temporary failure, just try the call again.
    <https://www.gnu.org/software/libc/manual/html_node/Interrupted-Primitives.html>
    
    Signed-off-by: Romain Vimont <rom@rom1v.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    rom1v committed with jwrdegoede Oct 11, 2016
Commits on Oct 25, 2016
  1. Release 1.0.21

    Closes #93
    
    Signed-off-by: Nathan Hjelm <hjelmn@mac.com>
    hjelmn committed Oct 25, 2016
  2. Remove generated file

    Signed-off-by: Nathan Hjelm <hjelmn@mac.com>
    hjelmn committed Oct 25, 2016
Commits on Oct 1, 2016
  1. fix travis matrix build

    Signed-off-by: Nathan Hjelm <hjelmn@me.com>
    hjelmn committed Oct 1, 2016
  2. try to get travis building with multiple macOS versions

    Signed-off-by: Nathan Hjelm <hjelmn@me.com>
    hjelmn committed Oct 1, 2016
  3. travis osx fix

    Signed-off-by: Nathan Hjelm <hjelmn@me.com>
    hjelmn committed Oct 1, 2016
  4. Windows: Fix possible false error message during device enumeration

    During early phases of enumeration, it is possible for a device to be
    enumerated before its parent. When this occurs, the device assigned as
    the parent will actually be a grandparent. During later phases of
    enumeration, the parent device will in fact exist but will not match
    what has already been assigned to the device.
    
    This commit adds code to check for and update the parent device when
    this situation occurs.
    
    Closes #206
    
    Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
    dickens committed with hjelmn Sep 14, 2016
  5. on to 1.0.21-rc6

    Signed-off-by: Nathan Hjelm <hjelmn@me.com>
    hjelmn committed Oct 1, 2016
Commits on Sep 21, 2016
  1. darwin: fix OSAtomicAdd32Barrier argument ordering

    Signed-off-by: Nathan Hjelm <hjelmn@me.com>
    hjelmn committed Sep 21, 2016
Commits on Sep 14, 2016
  1. on to 1.0.21-rc5

    Signed-off-by: Nathan Hjelm <hjelmn@me.gov>
    hjelmn committed Sep 14, 2016