Skip to content

Commit 129b47d

Browse files
committed
add __func__,__LINE__ to error message
1 parent 767df42 commit 129b47d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/dispatchers/file.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,10 +1244,11 @@ ncmpi_inq_file_format(const char *filename,
12441244
if (rlen != 8) {
12451245
close(fd); /* ignore error */
12461246
if (rlen == 0 && errno == 0)
1247-
fprintf(stderr, "Error: empty file %s\n", filename);
1247+
fprintf(stderr, "Error in %s at %d: empty file %s\n",
1248+
__func__,__LINE__,filename);
12481249
else
1249-
fprintf(stderr, "Error: fail to read signature of file %s\n",
1250-
filename);
1250+
fprintf(stderr, "Error in %s at %d: fail to read signature of file %s\n",
1251+
__func__,__LINE__,filename);
12511252
DEBUG_RETURN_ERROR(NC_EFILE)
12521253
}
12531254
if (close(fd) == -1) {

0 commit comments

Comments
 (0)