Den tors 15 nov. 2018 kl 12:55 skrev Gal Ben Haim <gbenhaim@xxxxxxxxxx>: > > I submitted a different patch - > https://marc.info/?l=linux-bluetooth&m=154228281730667&w=2 > On Thu, Nov 15, 2018 at 12:20 PM Gal Ben Haim <gbenhaim@xxxxxxxxxx> wrote: > > > > I can try to create another patch for it > > > > On Thu, Nov 15, 2018 at 12:18 PM Marcel Holtmann <marcel@xxxxxxxxxxxx> wrote: > > > > > > Hi Gal, > > > > > > > io_send can use poll and check for POLLOUT and POLLRDHUP before > > > > writing to the pipe > > > > > > that should be done anyway since code that writes to a pipe descriptor (or socket for that matter) without checking that it is still valid is broken code. > > > > > > Regards > > > > > > Marcel > > > Even if you first check for writability with poll, you still need to also ignore the SIGPIPE signal, since the connection could be reset after the check is made but before the write is executed, I guess. But the "signal(SIGPIPE, SIG_IGN)" should usually be made once at application initialization. /Emil