s6

Mirror/fork of https://skarnet.org/software/s6/
git clone https://ccx.te2000.cz/git/s6
Log | Files | Refs | README | LICENSE

s6_fdholder_start.c (392B)


      1 /* ISC license. */
      2 
      3 #include <skalibs/djbunix.h>
      4 #include <skalibs/socket.h>
      5 
      6 #include <s6/fdholder.h>
      7 
      8 int s6_fdholder_start (s6_fdholder_t *a, char const *path, tain const *deadline, tain *stamp)
      9 {
     10   int fd = ipc_stream_nb() ;
     11   if (fd < 0) return 0 ;
     12   if (!ipc_timed_connect(fd, path, deadline, stamp))
     13   {
     14     fd_close(fd) ;
     15     return 0 ;
     16   }
     17   s6_fdholder_init(a, fd) ;
     18   return 1 ;
     19 }