summaryrefslogtreecommitdiff
path: root/src/os_posix/os_open.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/os_posix/os_open.c')
-rw-r--r--src/os_posix/os_open.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/os_posix/os_open.c b/src/os_posix/os_open.c
index 5d6ac6942de..dc0e9293fb8 100644
--- a/src/os_posix/os_open.c
+++ b/src/os_posix/os_open.c
@@ -37,11 +37,12 @@ __wt_open(WT_SESSION_IMPL *session,
WT_FH *fh, *tfh;
mode_t mode;
uint64_t bucket, hash;
- int direct_io, f, fd, matched;
+ int f, fd;
+ bool direct_io, matched;
char *path;
conn = S2C(session);
- direct_io = 0;
+ direct_io = false;
fh = NULL;
fd = -1;
path = NULL;
@@ -49,7 +50,7 @@ __wt_open(WT_SESSION_IMPL *session,
WT_RET(__wt_verbose(session, WT_VERB_FILEOPS, "%s: open", name));
/* Increment the reference count if we already have the file open. */
- matched = 0;
+ matched = false;
hash = __wt_hash_city64(name, strlen(name));
bucket = hash % WT_HASH_ARRAY_SIZE;
__wt_spin_lock(session, &conn->fh_lock);
@@ -57,7 +58,7 @@ __wt_open(WT_SESSION_IMPL *session,
if (strcmp(name, tfh->name) == 0) {
++tfh->ref;
*fhp = tfh;
- matched = 1;
+ matched = true;
break;
}
}
@@ -103,7 +104,7 @@ __wt_open(WT_SESSION_IMPL *session,
#ifdef O_DIRECT
if (dio_type && FLD_ISSET(conn->direct_io, dio_type)) {
f |= O_DIRECT;
- direct_io = 1;
+ direct_io = true;
}
#endif
if (dio_type == WT_FILE_TYPE_LOG &&
@@ -165,13 +166,13 @@ setupfh:
* Repeat the check for a match, but then link onto the database's list
* of files.
*/
- matched = 0;
+ matched = false;
__wt_spin_lock(session, &conn->fh_lock);
TAILQ_FOREACH(tfh, &conn->fhhash[bucket], hashq) {
if (strcmp(name, tfh->name) == 0) {
++tfh->ref;
*fhp = tfh;
- matched = 1;
+ matched = true;
break;
}
}