@@ -57,30 +57,34 @@ read_file_and_null_terminate (const char *filename, size_t *out_len)
5757 FILE * file = fopen (filename , "rb" );
5858 if (!file ) {
5959 MONGOC_ERROR ("Failed to open file: '%s' with error: '%s'" ,
60+ filename ,
6061 bson_strerror_r (errno , errmsg_buf , sizeof errmsg_buf ));
6162 goto fail ;
6263 }
6364
6465 if (0 != fseek (file , 0 , SEEK_END )) {
6566 MONGOC_ERROR ("Failed to seek in file: '%s' with error: '%s'" ,
67+ filename ,
6668 bson_strerror_r (errno , errmsg_buf , sizeof errmsg_buf ));
6769 goto fail ;
6870 }
6971
7072 long file_len = ftell (file );
7173 if (file_len < 0 ) {
7274 MONGOC_ERROR ("Failed to get length of file: '%s' with error: '%s'" ,
75+ filename ,
7376 bson_strerror_r (errno , errmsg_buf , sizeof errmsg_buf ));
7477 goto fail ;
7578 }
7679
7780 if (file_len > LONG_MAX - 1 ) {
78- MONGOC_ERROR ("Failed to get length of file: '%s'. File too large" );
81+ MONGOC_ERROR ("Failed to get length of file: '%s'. File too large" , filename );
7982 goto fail ;
8083 }
8184
8285 if (0 != fseek (file , 0 , SEEK_SET )) {
8386 MONGOC_ERROR ("Failed to seek in file: '%s' with error: '%s'" ,
87+ filename ,
8488 bson_strerror_r (errno , errmsg_buf , sizeof errmsg_buf ));
8589 goto fail ;
8690 }
@@ -94,6 +98,7 @@ read_file_and_null_terminate (const char *filename, size_t *out_len)
9498 goto fail ;
9599 } else {
96100 MONGOC_ERROR ("Failed to read file: '%s' with error: '%s'" ,
101+ filename ,
97102 bson_strerror_r (errno , errmsg_buf , sizeof errmsg_buf ));
98103 goto fail ;
99104 }
0 commit comments