commit | 0b3a2ed92d45a78a13b5abce61d87d0d43ce09d8 | [log] [tgz] |
---|---|---|
author | Chris Dickens <christopher.a.dickens@gmail.com> | Thu Mar 05 23:19:55 2020 -0800 |
committer | Chris Dickens <christopher.a.dickens@gmail.com> | Thu Mar 05 23:19:55 2020 -0800 |
tree | 1513d71f6efa9bafcb071b620d416a917511dd00 | |
parent | ec01c28e1e892b410bdd1581a2bd4e46cbd03eac [diff] |
core: Switch usbi_transfer to store timeout as timespec The transfer timeout is structured around time values provided by the clock_gettime() function. This function uses a timespec structure, but the usbi_transfer structure was storing its calculated timeout in a timeval structure. This mismatch introduces extra work when checking for transfer timeouts as there must be a conversion between these two structures. Eliminate this by storing the calculated timeout as a timespec, thus allowing direct comparison. Note that a conversion to a timeval is still necessary in the libusb_get_next_timeout() function because the public API uses a timeval structure, but this is now the only place where such a conversion is done. Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
libusb is a library for USB device access from Linux, macOS, Windows, OpenBSD/NetBSD and Haiku userspace. It is written in C (Haiku backend in C++) and licensed under the GNU Lesser General Public License version 2.1 or, at your option, any later version (see COPYING).
libusb is abstracted internally in such a way that it can hopefully be ported to other operating systems. Please see the PORTING file for more information.
libusb homepage: http://libusb.info/
Developers will wish to consult the API documentation: http://api.libusb.info
Use the mailing list for questions, comments, etc: http://mailing-list.libusb.info
(Please use the mailing list rather than mailing developers directly)