summaryrefslogtreecommitdiff
path: root/src/libunixonacid/skaclient_start_cb.c
blob: 4a82b9bb4eb2968ce630410b5d63e62ca6f65242 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* ISC license. */

#include <errno.h>
#include <skalibs/bytestr.h>
#include <skalibs/error.h>
#include <skalibs/skaclient.h>
#include <skalibs/unixmessage.h>
#include "skaclient-internal.h"

int skaclient_start_cb (unixmessage_t const *m, skaclient_cbdata_t *blah)
{
  if (m->len != blah->afterlen
   || byte_diff(m->s, m->len, blah->after)
   || m->nfds != 1) return (errno = EPROTO, 0) ;
  blah->asyncin->fd = m->fds[0] ;
  blah->asyncout->fd = m->fds[0] ;
  return 1 ;
}