diff options
Diffstat (limited to 'src/platform-info-binding.c')
-rw-r--r-- | src/platform-info-binding.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/platform-info-binding.c b/src/platform-info-binding.c index c6bc9fd..dd18d0d 100644 --- a/src/platform-info-binding.c +++ b/src/platform-info-binding.c @@ -86,7 +86,12 @@ void afv_subscribe(afb_req_t req) { int init(afb_api_t api) { struct dirent* dir_ent = NULL; + DIR* dir_handle = opendir(PLATFORM_INFO_DIR); + if (! dir_handle) { + AFB_ERROR("The directory %s does not exists.", PLATFORM_INFO_DIR); + return -1; + } json_object *json_file = json_object_new_object(), *current_file = NULL; while( (dir_ent = readdir(dir_handle)) != NULL) { |