chiark
/
gitweb
/
~mdw
/
ezmlm
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
Import ezmlm-idx 0.40
[ezmlm]
/
slurp.c
1
#include "stralloc.h"
2
#include "slurp.h"
3
#include "error.h"
4
#include "open.h"
5
6
int slurp(fn,sa,bufsize)
7
char *fn;
8
stralloc *sa;
9
int bufsize;
10
{
11
int fd;
12
fd = open_read(fn);
13
if (fd == -1) {
14
if (errno == error_noent) return 0;
15
return -1;
16
}
17
if (slurpclose(fd,sa,bufsize) == -1) return -1;
18
return 1;
19
}