core: allow libusb_set_option on the default context before libusb_init
authorNathan Hjelm <hjelmn@google.com>
Sun, 6 Jun 2021 18:19:05 +0000 (12:19 -0600)
committerNathan Hjelm <hjelmn@google.com>
Tue, 8 Jun 2021 03:28:44 +0000 (21:28 -0600)
commita524555c987fec2c16417d2f58c8713efcbe11a9
treea189629bded2dfd336de94370e195d7fe9ae34b1
parentd551802db593436947a2464a7da1020edf0e7b56
core: allow libusb_set_option on the default context before libusb_init

This commit updates libusb_set_option to save the options if setting them on the default
context. This ensures the options 1) can be set before libusb_init(NULL, ...), and 2)
are honored even if the default context is destroyed and re-created.

Signed-off-by: Nathan Hjelm <hjelmn@google.com>
libusb/core.c
libusb/libusb.h
libusb/libusbi.h
libusb/version_nano.h
tests/stress.c