summaryrefslogtreecommitdiff
path: root/src/libunixonacid/skaclient_syncify.c
blob: 08b7b9ae145c67445dcf5c97e2b6048d54bab733 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* ISC license. */

#include <errno.h>
#include <skalibs/tai.h>
#include <skalibs/skaclient.h>

int skaclient_syncify (skaclient_t *a, tain_t const *deadline, tain_t *stamp)
{
  register int r ;
  if (!skaclient_timed_flush(a, deadline, stamp)) return 0 ;
  r = skaclient_timed_supdate(a, deadline, stamp) ;
  return r < 0 ? 0 : !r ? (errno = EPIPE, 0) : 1 ;
}