Skip to content

Commit 24237eb

Browse files
committed
Ignore SIGPIPE in the btle fifo transport
1 parent 07ea19f commit 24237eb

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

btle/common/btle-sim.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include <stdio.h>
3232
#include <fcntl.h>
3333
#include <unistd.h>
34+
#include <signal.h>
3435
#include <string.h>
3536

3637
#include "btle-sim.h"
@@ -134,6 +135,10 @@ int btle_open(void** dev, int role)
134135
{
135136
int fdmiso, fdmosi;
136137

138+
/* Both peers shut the TLS session down, so whichever writes its close_notify
139+
* after the other has gone would take a fatal SIGPIPE on the fifo. */
140+
signal(SIGPIPE, SIG_IGN);
141+
137142
mkfifo(kBtleMisoFifo, 0666);
138143
mkfifo(kBtleMosiFifo, 0666);
139144

0 commit comments

Comments
 (0)