[Glibc-bsd-commits] r5429 - in trunk/freebsd-libs/debian: . patches
rmh at alioth.debian.org
rmh at alioth.debian.org
Sat Feb 15 16:08:15 UTC 2014
Author: rmh
Date: 2014-02-15 16:08:15 +0000 (Sat, 15 Feb 2014)
New Revision: 5429
Added:
trunk/freebsd-libs/debian/patches/libusb_handle_events_completed.diff
Modified:
trunk/freebsd-libs/debian/changelog
trunk/freebsd-libs/debian/libusb3.symbols
trunk/freebsd-libs/debian/patches/series
Log:
* libusb_handle_events_completed.diff: Cherry-pick from upstream
(add libusb_handle_events_completed and
libusb_handle_events_timeout_completed). (Closes: #738986)
Modified: trunk/freebsd-libs/debian/changelog
===================================================================
--- trunk/freebsd-libs/debian/changelog 2014-02-15 01:23:17 UTC (rev 5428)
+++ trunk/freebsd-libs/debian/changelog 2014-02-15 16:08:15 UTC (rev 5429)
@@ -1,3 +1,11 @@
+freebsd-libs (10.0-4) experimental; urgency=low
+
+ * libusb_handle_events_completed.diff: Cherry-pick from upstream
+ (add libusb_handle_events_completed and
+ libusb_handle_events_timeout_completed). (Closes: #738986)
+
+ -- Robert Millan <rmh at debian.org> Sat, 15 Feb 2014 15:43:59 +0100
+
freebsd-libs (10.0-3) experimental; urgency=low
* Add missing B-D on m4.
Modified: trunk/freebsd-libs/debian/libusb3.symbols
===================================================================
--- trunk/freebsd-libs/debian/libusb3.symbols 2014-02-15 01:23:17 UTC (rev 5428)
+++ trunk/freebsd-libs/debian/libusb3.symbols 2014-02-15 16:08:15 UTC (rev 5429)
@@ -152,8 +152,10 @@
libusb_get_string_descriptor at Base 10.0
libusb_get_string_descriptor_ascii at Base 7.1
libusb_handle_events at Base 7.1
+ libusb_handle_events_completed at Base 10.0-4~
libusb_handle_events_locked at Base 7.1
libusb_handle_events_timeout at Base 7.1
+ libusb_handle_events_timeout_completed at Base 10.0-4~
libusb_init at Base 7.1
libusb_interrupt_transfer at Base 7.1
libusb_kernel_driver_active at Base 7.1
Added: trunk/freebsd-libs/debian/patches/libusb_handle_events_completed.diff
===================================================================
--- trunk/freebsd-libs/debian/patches/libusb_handle_events_completed.diff (rev 0)
+++ trunk/freebsd-libs/debian/patches/libusb_handle_events_completed.diff 2014-02-15 16:08:15 UTC (rev 5429)
@@ -0,0 +1,165 @@
+------------------------------------------------------------------------
+r261482 | hselasky | 2014-02-04 11:18:29 +0100 (dt, 04 feb 2014) | 5 lines
+
+MFC r260315:
+Implement two new libusb API functions.
+
+PR: usb/185454
+
+------------------------------------------------------------------------
+
+--- a/lib/libusb/Makefile
++++ b/lib/libusb/Makefile
+@@ -130,6 +130,8 @@
+ MLINKS += libusb.3 libusb_lock_event_waiters.3
+ MLINKS += libusb.3 libusb_unlock_event_waiters.3
+ MLINKS += libusb.3 libusb_wait_for_event.3
++MLINKS += libusb.3 libusb_handle_events_timeout_completed.3
++MLINKS += libusb.3 libusb_handle_events_completed.3
+ MLINKS += libusb.3 libusb_handle_events_timeout.3
+ MLINKS += libusb.3 libusb_handle_events.3
+ MLINKS += libusb.3 libusb_handle_events_locked.3
+--- a/lib/libusb/libusb.3
++++ b/lib/libusb/libusb.3
+@@ -26,7 +26,7 @@
+ .\"
+ .\" $FreeBSD$
+ .\"
+-.Dd June 7, 2013
++.Dd January 5, 2014
+ .Dt LIBUSB 3
+ .Os
+ .Sh NAME
+@@ -485,11 +485,40 @@
+ timeout expired.
+ .Pp
+ .Ft int
++.Fn libusb_handle_events_timeout_completed "libusb_context *ctx" "struct timeval *tv" "int *completed"
++Handle any pending events by checking if timeouts have expired and by
++checking the set of file descriptors for activity.
++If the
++.Fa completed
++argument is not equal to NULL, this function will
++loop until a transfer completion callback sets the variable pointed to
++by the
++.Fa completed
++argument to non-zero.
++If the
++.Fa tv
++argument is not equal to NULL, this function will return
++LIBUSB_ERROR_TIMEOUT after the given timeout.
++Returns 0 on success, or a LIBUSB_ERROR code on failure or timeout.
++.Pp
++.Ft int
++.Fn libusb_handle_events_completed "libusb_context *ctx" "int *completed"
++Handle any pending events by checking the set of file descriptors for activity.
++If the
++.Fa completed
++argument is not equal to NULL, this function will
++loop until a transfer completion callback sets the variable pointed to
++by the
++.Fa completed
++argument to non-zero.
++Returns 0 on success, or a LIBUSB_ERROR code on failure.
++.Pp
++.Ft int
+ .Fn libusb_handle_events_timeout "libusb_context *ctx" "struct timeval *tv"
+ Handle any pending events by checking if timeouts have expired and by
+ checking the set of file descriptors for activity.
+ Returns 0 on success, or a
+-LIBUSB_ERROR code on failure.
++LIBUSB_ERROR code on failure or timeout.
+ .Pp
+ .Ft int
+ .Fn libusb_handle_events "libusb_context *ctx"
+@@ -508,7 +537,7 @@
+ Determine the next internal timeout that libusb needs to handle.
+ Returns 0
+ if there are no pending timeouts, 1 if a timeout was returned, or a LIBUSB_ERROR
+-code on failure.
++code on failure or timeout.
+ .Pp
+ .Ft void
+ .Fn libusb_set_pollfd_notifiers "libusb_context *ctx" "libusb_pollfd_added_cb added_cb" "libusb_pollfd_removed_cb remove_cb" "void *user_data"
+--- a/lib/libusb/libusb.h
++++ b/lib/libusb/libusb.h
+@@ -438,6 +438,8 @@
+ void libusb_lock_event_waiters(libusb_context * ctx);
+ void libusb_unlock_event_waiters(libusb_context * ctx);
+ int libusb_wait_for_event(libusb_context * ctx, struct timeval *tv);
++int libusb_handle_events_timeout_completed(libusb_context * ctx, struct timeval *tv, int *completed);
++int libusb_handle_events_completed(libusb_context * ctx, int *completed);
+ int libusb_handle_events_timeout(libusb_context * ctx, struct timeval *tv);
+ int libusb_handle_events(libusb_context * ctx);
+ int libusb_handle_events_locked(libusb_context * ctx, struct timeval *tv);
+--- a/lib/libusb/libusb10_io.c
++++ b/lib/libusb/libusb10_io.c
+@@ -336,29 +336,50 @@
+ }
+
+ int
+-libusb_handle_events_timeout(libusb_context *ctx, struct timeval *tv)
++libusb_handle_events_timeout_completed(libusb_context *ctx,
++ struct timeval *tv, int *completed)
+ {
+- int err;
++ int err = 0;
+
+ ctx = GET_CONTEXT(ctx);
+
+- DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_handle_events_timeout enter");
++ DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_handle_events_timeout_completed enter");
+
+ libusb_lock_events(ctx);
+
+- err = libusb_handle_events_locked(ctx, tv);
++ while (1) {
++ if (completed != NULL) {
++ if (*completed != 0 || err != 0)
++ break;
++ }
++ err = libusb_handle_events_locked(ctx, tv);
++ if (completed == NULL)
++ break;
++ }
+
+ libusb_unlock_events(ctx);
+
+- DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_handle_events_timeout leave");
++ DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_handle_events_timeout_completed exit");
+
+ return (err);
+ }
+
+ int
++libusb_handle_events_completed(libusb_context *ctx, int *completed)
++{
++ return (libusb_handle_events_timeout_completed(ctx, NULL, completed));
++}
++
++int
++libusb_handle_events_timeout(libusb_context *ctx, struct timeval *tv)
++{
++ return (libusb_handle_events_timeout_completed(ctx, tv, NULL));
++}
++
++int
+ libusb_handle_events(libusb_context *ctx)
+ {
+- return (libusb_handle_events_timeout(ctx, NULL));
++ return (libusb_handle_events_timeout_completed(ctx, NULL, NULL));
+ }
+
+ int
+@@ -371,8 +392,9 @@
+ if (libusb_event_handling_ok(ctx)) {
+ err = libusb10_handle_events_sub(ctx, tv);
+ } else {
+- libusb_wait_for_event(ctx, tv);
+- err = 0;
++ err = libusb_wait_for_event(ctx, tv);
++ if (err != 0)
++ err = LIBUSB_ERROR_TIMEOUT;
+ }
+ return (err);
+ }
Modified: trunk/freebsd-libs/debian/patches/series
===================================================================
--- trunk/freebsd-libs/debian/patches/series 2014-02-15 01:23:17 UTC (rev 5428)
+++ trunk/freebsd-libs/debian/patches/series 2014-02-15 16:08:15 UTC (rev 5429)
@@ -1,5 +1,6 @@
# Patches from (or merged in) upstream
svn_HEAD_Makefile.inc.diff
+libusb_handle_events_completed.diff
# Patches that are in good shape for merging upstream
More information about the Glibc-bsd-commits
mailing list