filepath
char *filepath;
if (asprintf(&filepath, "%s/%s", cert_path, filename) == -1)
if ((fd = open(filepath, O_RDONLY)) == -1)
err(1, "failed to open '%s'", filepath);
err(1, "failed to stat '%s'", filepath);
err(1, "file size invalid for '%s'", filepath);
err(1, "failed to read '%s'", filepath);
free(filepath);
char *filename, filepath[RMPBOOTDATA+1];
dst1 = filepath;
if ((filename = strrchr(filepath,'/')) != NULL)
filename = filepath;
struct filepath;
RB_HEAD(filepath_tree, filepath);
RB_ENTRY(filepath) entry;
filepathcmp(const struct filepath *a, const struct filepath *b)
RB_PROTOTYPE(filepath_tree, filepath, entry, filepathcmp);
struct filepath *fp, *rfp;
struct filepath *fp, *nfp;
static struct filepath *
struct filepath needle = { .file = file };
struct filepath *fp, *nfp, *ofp;
struct filepath *fp;
filepath_put(struct filepath_tree *tree, struct filepath *fp)
struct filepath *fp, *nfp;
RB_GENERATE(filepath_tree, filepath, entry, filepathcmp);
struct filepath *fp;