28 lines
492 B
C
28 lines
492 B
C
#include <errno.h>
|
|
#include <fcntl.h>
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <unistd.h>
|
|
|
|
#include <cli.h>
|
|
|
|
#include "ft_ssl.h"
|
|
#include "internal/ssl/ssl.h"
|
|
#include "version_gen.h"
|
|
|
|
int
|
|
run_file(const struct digest_config *config, const char *path)
|
|
{
|
|
int fd;
|
|
int ret;
|
|
|
|
fd = open(path, O_RDONLY);
|
|
if (0 > fd)
|
|
{
|
|
fprintf(stderr, "%s: %s: %s\n", g_prog_name, path, strerror(errno));
|
|
return CLI_ERROR;
|
|
}
|
|
ret = digest_stream(config, fd, path, 1, 0);
|
|
close(fd);
|
|
return ret;
|
|
}
|