summaryrefslogtreecommitdiff
path: root/src/libstddjb/iobuffer_flush.c
blob: 543744bdeec2735e493b78ba33c068a8830e6b7d (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_ref 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) ;
}