From 0abe0099be00abc3c81488b932f18366953cdfde Mon Sep 17 00:00:00 2001 From: josch Date: Mon, 1 Dec 2014 17:23:28 +0100 Subject: [PATCH] fail if hashtable cannot be loaded --- fuse/main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fuse/main.c b/fuse/main.c index 19c48f5..08e48b5 100644 --- a/fuse/main.c +++ b/fuse/main.c @@ -553,10 +553,15 @@ static void connect_mf(struct mediafirefs_user_options *options, fp = fopen(ctx->dircache, "r"); if (fp != NULL) { // file exists - fprintf(stderr, "loading hashtable\n"); + fprintf(stderr, "loading hashtable from %s\n", ctx->dircache); ctx->tree = folder_tree_load(fp, ctx->filecache); + if (ctx->tree == NULL) { + fprintf(stderr, "cannot load directory hashtable\n"); + exit(1); + } + fclose(fp); folder_tree_update(ctx->tree, ctx->conn);