summaryrefslogtreecommitdiff
path: root/src/libstddjb/iobuffer_flush.c
blob: 93efc9d890a2a002f347e51ddf474d9f280fa14e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* ISC license. */

#include <errno.h>
#include <skalibs/iobuffer.h>

int iobuffer_flush (iobuffer *b)
{
  if (b->isk)
  {
    if (iobufferk_flush(&b->x.k)) return 1 ;
    if (errno != ENOSYS || !iobuffer_salvage(b)) return 0 ;
  }
  return iobufferu_flush(&b->x.u) ;
}