summaryrefslogtreecommitdiff
path: root/src/os_posix/os_stdio.c
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2015-04-02 13:06:19 -0400
committerKeith Bostic <keith@wiredtiger.com>2015-04-02 13:06:19 -0400
commitd3dacbffd2a87ea79ec05fa569bdd5d34f90254c (patch)
tree7c7c324ccee91fb31c7aca145ab230aff2e5058e /src/os_posix/os_stdio.c
parenteee8167eb19ca4e9b779b0364bbaef1b920150f8 (diff)
downloadmongo-d3dacbffd2a87ea79ec05fa569bdd5d34f90254c.tar.gz
Make --with-spinlock=pthread_logging option compile again.
Remove the WT_SESSION_IMPL argument to the fprintf, vfprintf, fflush and fclose functions, there are places we want to use it that don't have session handles, and it's not currently needed. Clean up error handling in the vfprintf function.
Diffstat (limited to 'src/os_posix/os_stdio.c')
-rw-r--r--src/os_posix/os_stdio.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/os_posix/os_stdio.c b/src/os_posix/os_stdio.c
index 8d97fdd2880..da880f5521e 100644
--- a/src/os_posix/os_stdio.c
+++ b/src/os_posix/os_stdio.c
@@ -59,13 +59,9 @@ __wt_fopen(WT_SESSION_IMPL *session,
* Vfprintf for a FILE handle.
*/
int
-__wt_vfprintf(WT_SESSION_IMPL *session, FILE *fp, const char *fmt, va_list ap)
+__wt_vfprintf(FILE *fp, const char *fmt, va_list ap)
{
- WT_DECL_RET;
-
- WT_UNUSED(session);
-
- return (vfprintf(fp, fmt, ap) < 0 ? __wt_errno() : ret);
+ return (vfprintf(fp, fmt, ap) < 0 ? __wt_errno() : 0);
}
/*
@@ -73,14 +69,14 @@ __wt_vfprintf(WT_SESSION_IMPL *session, FILE *fp, const char *fmt, va_list ap)
* Fprintf for a FILE handle.
*/
int
-__wt_fprintf(WT_SESSION_IMPL *session, FILE *fp, const char *fmt, ...)
- WT_GCC_FUNC_ATTRIBUTE((format (printf, 3, 4)))
+__wt_fprintf(FILE *fp, const char *fmt, ...)
+ WT_GCC_FUNC_ATTRIBUTE((format (printf, 2, 3)))
{
WT_DECL_RET;
va_list ap;
va_start(ap, fmt);
- ret = __wt_vfprintf(session, fp, fmt, ap);
+ ret = __wt_vfprintf(fp, fmt, ap);
va_end(ap);
return (ret);
@@ -91,10 +87,8 @@ __wt_fprintf(WT_SESSION_IMPL *session, FILE *fp, const char *fmt, ...)
* Flush a FILE handle.
*/
int
-__wt_fflush(WT_SESSION_IMPL *session, FILE *fp)
+__wt_fflush(FILE *fp)
{
- WT_UNUSED(session);
-
/* Flush the handle. */
return (fflush(fp) == 0 ? 0 : __wt_errno());
}
@@ -104,7 +98,7 @@ __wt_fflush(WT_SESSION_IMPL *session, FILE *fp)
* Close a FILE handle.
*/
int
-__wt_fclose(WT_SESSION_IMPL *session, FILE **fpp, WT_FHANDLE_MODE mode_flag)
+__wt_fclose(FILE **fpp, WT_FHANDLE_MODE mode_flag)
{
FILE *fp;
WT_DECL_RET;
@@ -120,7 +114,7 @@ __wt_fclose(WT_SESSION_IMPL *session, FILE **fpp, WT_FHANDLE_MODE mode_flag)
* OS buffers, then flush the OS buffers to the backing disk.
*/
if (mode_flag == WT_FHANDLE_APPEND || mode_flag == WT_FHANDLE_WRITE) {
- ret = __wt_fflush(session, fp);
+ ret = __wt_fflush(fp);
if (fsync(fileno(fp)) != 0)
WT_TRET(__wt_errno());
}