@@ -57,30 +57,34 @@ read_file_and_null_terminate (const char *filename, size_t *out_len)
57
57
FILE * file = fopen (filename , "rb" );
58
58
if (!file ) {
59
59
MONGOC_ERROR ("Failed to open file: '%s' with error: '%s'" ,
60
+ filename ,
60
61
bson_strerror_r (errno , errmsg_buf , sizeof errmsg_buf ));
61
62
goto fail ;
62
63
}
63
64
64
65
if (0 != fseek (file , 0 , SEEK_END )) {
65
66
MONGOC_ERROR ("Failed to seek in file: '%s' with error: '%s'" ,
67
+ filename ,
66
68
bson_strerror_r (errno , errmsg_buf , sizeof errmsg_buf ));
67
69
goto fail ;
68
70
}
69
71
70
72
long file_len = ftell (file );
71
73
if (file_len < 0 ) {
72
74
MONGOC_ERROR ("Failed to get length of file: '%s' with error: '%s'" ,
75
+ filename ,
73
76
bson_strerror_r (errno , errmsg_buf , sizeof errmsg_buf ));
74
77
goto fail ;
75
78
}
76
79
77
80
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 );
79
82
goto fail ;
80
83
}
81
84
82
85
if (0 != fseek (file , 0 , SEEK_SET )) {
83
86
MONGOC_ERROR ("Failed to seek in file: '%s' with error: '%s'" ,
87
+ filename ,
84
88
bson_strerror_r (errno , errmsg_buf , sizeof errmsg_buf ));
85
89
goto fail ;
86
90
}
@@ -94,6 +98,7 @@ read_file_and_null_terminate (const char *filename, size_t *out_len)
94
98
goto fail ;
95
99
} else {
96
100
MONGOC_ERROR ("Failed to read file: '%s' with error: '%s'" ,
101
+ filename ,
97
102
bson_strerror_r (errno , errmsg_buf , sizeof errmsg_buf ));
98
103
goto fail ;
99
104
}
0 commit comments