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

#include <skalibs/djbunix.h>

int openslurpnclose (char const *fn, stralloc *sa, size_t max)
{
  int r ;
  int fd = openbc_read(fn) ;
  if (fd == -1) return 0 ;
  r = slurpn(fd, sa, max) ;
  fd_close(fd) ;
  return r ;
}