You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
319 B
C
17 lines
319 B
C
#include <errno.h>
|
|
#include "open.h"
|
|
#include "readclose.h"
|
|
#include "openreadclose.h"
|
|
|
|
int openreadclose(const char *fn,stralloc *sa,size_t bufsize)
|
|
{
|
|
int fd;
|
|
fd = open_read(fn);
|
|
if (fd == -1) {
|
|
if (errno == ENOENT) return 0;
|
|
return -1;
|
|
}
|
|
if (readclose(fd,sa,bufsize) == -1) return -1;
|
|
return 1;
|
|
}
|