libusb(3): Ignore SIGPIPE when initializing the LibUSB v1.0 API.

The LibUSB v1.0 emulation layer uses pipes internally to signal between
threads. When USB devices are reset, as part of loading firmware, SIGPIPE
may happen, and that is expected and should be ignored.

PR:		261891
MFC after:	1 week
Sponsored by:	NVIDIA Networking
This commit is contained in:
Hans Petter Selasky 2022-03-02 12:31:27 +01:00
parent 369216b039
commit d94d94e2c0
2 changed files with 4 additions and 0 deletions

View File

@ -34,6 +34,7 @@
#include <errno.h>
#include <poll.h>
#include <pthread.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -226,6 +227,8 @@ libusb_init(libusb_context **context)
DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_init complete");
signal(SIGPIPE, SIG_IGN);
return (0);
}

View File

@ -50,6 +50,7 @@
#include <fcntl.h>
#include <limits.h>
#include <setjmp.h>
#include <signal.h>
#include <pthread.h>
#include <sys/queue.h>
#include <sys/ioctl.h>