summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPete Batard <pbatard@gmail.com>2010-07-30 00:02:02 +0100
committerPete Batard <pbatard@gmail.com>2010-07-30 00:02:02 +0100
commitb315c285a1b9920aad448419dc720ca91d9b869d (patch)
tree01306d46b45c901092e2953a9941aaca5decc96a
parent543371cc8fb78b5bf4ea69b9fff6824332155e5a (diff)
downloadlibusb-b315c285a1b9920aad448419dc720ca91d9b869d.tar.gz
more residuals from official: core
-rw-r--r--libusb/core.c14
-rw-r--r--libusb/io.c3
-rw-r--r--libusb/sync.c1
3 files changed, 5 insertions, 13 deletions
diff --git a/libusb/core.c b/libusb/core.c
index 1d5c9b3..6743c13 100644
--- a/libusb/core.c
+++ b/libusb/core.c
@@ -19,6 +19,7 @@
*/
#include <config.h>
+
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
@@ -1471,9 +1472,6 @@ API_EXPORTED int LIBUSB_API libusb_attach_kernel_driver(libusb_device_handle *de
API_EXPORTED void LIBUSB_API libusb_set_debug(libusb_context *ctx, int level)
{
USBI_GET_CONTEXT(ctx);
- // ctx can be NULL if called before libusb_init
- if (ctx == NULL)
- return;
if (!ctx->debug_fixed)
ctx->debug = level;
}
@@ -1512,9 +1510,6 @@ API_EXPORTED int LIBUSB_API libusb_init(libusb_context **context)
goto err_unlock;
}
memset(ctx, 0, sizeof(*ctx));
-#ifdef USBI_TIMERFD_AVAILABLE
- ctx->timerfd = -1;
-#endif
if (dbg) {
ctx->debug = atoi(dbg);
@@ -1530,11 +1525,6 @@ API_EXPORTED int LIBUSB_API libusb_init(libusb_context **context)
usbi_dbg("");
- usbi_mutex_init(&ctx->usb_devs_lock, NULL);
- usbi_mutex_init(&ctx->open_devs_lock, NULL);
- list_init(&ctx->usb_devs);
- list_init(&ctx->open_devs);
-
if (usbi_backend->init) {
r = usbi_backend->init(ctx);
if (r)
@@ -1560,13 +1550,13 @@ API_EXPORTED int LIBUSB_API libusb_init(libusb_context **context)
usbi_default_context = ctx;
default_context_refcnt++;
}
+ usbi_mutex_static_unlock(&default_context_lock);
return 0;
err_destroy_mutex:
if (usbi_default_context == ctx)
usbi_default_context = NULL;
- usbi_mutex_static_unlock(&default_context_lock);
usbi_mutex_destroy(&ctx->open_devs_lock);
usbi_mutex_destroy(&ctx->usb_devs_lock);
err_free_ctx:
diff --git a/libusb/io.c b/libusb/io.c
index c9b0ba4..2e25e33 100644
--- a/libusb/io.c
+++ b/libusb/io.c
@@ -21,6 +21,7 @@
#include <config.h>
#include <errno.h>
#include <signal.h>
+#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
@@ -1962,7 +1963,7 @@ retry:
return r;
}
- /* another thread is doing event handling. wait for thread events that
+ /* another thread is doing event handling. wait for pthread events that
* notify event completion. */
libusb_lock_event_waiters(ctx);
diff --git a/libusb/sync.c b/libusb/sync.c
index 1d3796f..0c6d3ff 100644
--- a/libusb/sync.c
+++ b/libusb/sync.c
@@ -19,6 +19,7 @@
#include <config.h>
#include <errno.h>
+#include <stdint.h>
#include <stdlib.h>
#include <string.h>