diff options
Diffstat (limited to 'src/os_posix/os_filesize.c')
-rw-r--r-- | src/os_posix/os_filesize.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/os_posix/os_filesize.c b/src/os_posix/os_filesize.c index 09174ffcd90..c58f73b0665 100644 --- a/src/os_posix/os_filesize.c +++ b/src/os_posix/os_filesize.c @@ -34,8 +34,8 @@ __wt_filesize(WT_SESSION_IMPL *session, WT_FH *fh, wt_off_t *sizep) * Return the size of a file in bytes, given a file name. */ int -__wt_filesize_name( - WT_SESSION_IMPL *session, const char *filename, wt_off_t *sizep) +__wt_filesize_name(WT_SESSION_IMPL *session, + const char *filename, bool silent, wt_off_t *sizep) { struct stat sb; WT_DECL_RET; @@ -47,9 +47,16 @@ __wt_filesize_name( __wt_free(session, path); - if (ret == 0) + if (ret == 0) { *sizep = sb.st_size; + return (0); + } - /* Some callers expect failure, so don't log an error message. */ + /* + * Some callers of this function expect failure if the file doesn't + * exist, and don't want an error message logged. + */ + if (!silent) + WT_RET_MSG(session, ret, "%s: fstat", filename); return (ret); } |