summaryrefslogtreecommitdiff
path: root/src/libs6/ftrigw_notifyb.c
blob: 36871ecf505efc0a963b6c951e12714d25909e40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* ISC license. */

#include <sys/types.h>
#include <errno.h>
#include <signal.h>
#include <skalibs/sig.h>
#include <s6/ftrigw.h>

int ftrigw_notifyb (char const *path, char const *s, size_t len)
{
  struct skasigaction old ;
  int r ;
  if (skasigaction(SIGPIPE, &SKASIG_IGN, &old) < 0) return -1 ;
  r = ftrigw_notifyb_nosig(path, s, len) ;
  {
    int e = errno ;
    skasigaction(SIGPIPE, &old, 0) ;
    errno = e ;
  }
  return r ;
}