File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed
Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change 4545#include <ipfixcol2.h>
4646#include <ctype.h>
4747#include <inttypes.h>
48+ #include <errno.h>
4849
4950/** Default size of the mapping database */
5051#define DEF_SIZE 32
@@ -289,6 +290,10 @@ map_load(map_t *map, const char *file)
289290 // Open the file
290291 FILE * ur_file = fopen (file , "r" );
291292 if (!ur_file ) {
293+ const char * err_str ;
294+ ipx_strerror (errno , err_str );
295+ snprintf (map -> err_buffer , ERR_SIZE , "Failed to open configuration file '%s': %s" ,
296+ file , err_str );
292297 return IPX_ERR_DENIED ;
293298 }
294299
Original file line number Diff line number Diff line change @@ -82,6 +82,8 @@ map_destroy(map_t *map);
8282
8383/**
8484 * \brief Load a mapping database from a file
85+ *
86+ * \note In case of an error, an error message is filled (see map_last_error())
8587 * \param[in] map Mapping database
8688 * \param[in] file Path to the file
8789 * \return #IPX_OK on success
You can’t perform that action at this time.
0 commit comments