Commit bbcfe0f4 authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

fix some icc on linux errors in the fractal tree refs[t:2500]

git-svn-id: file:///svn/toku/tokudb@18993 c7de825b-a66e-492c-adef-691d508d4ae1
parent d3dbd816
......@@ -102,16 +102,17 @@ toku_set_func_pwrite (ssize_t (*pwrite_fun)(int, const void *, size_t, off_t)) {
void
toku_os_full_pwrite (int fd, const void *buf, size_t len, off_t off) {
const char *bp = (const char *) buf;
while (len > 0) {
ssize_t r;
if (t_pwrite) {
r = t_pwrite(fd, buf, len, off);
r = t_pwrite(fd, bp, len, off);
} else {
r = pwrite(fd, buf, len, off);
r = pwrite(fd, bp, len, off);
}
if (r > 0) {
len -= r;
buf += r;
bp += r;
off += r;
}
else {
......@@ -131,16 +132,17 @@ toku_set_func_write (ssize_t (*write_fun)(int, const void *, size_t)) {
void
toku_os_full_write (int fd, const void *buf, size_t len) {
const char *bp = (const char *) buf;
while (len > 0) {
ssize_t r;
if (t_write) {
r = t_write(fd, buf, len);
r = t_write(fd, bp, len);
} else {
r = write(fd, buf, len);
r = write(fd, bp, len);
}
if (r > 0) {
len -= r;
buf += r;
bp += r;
}
else {
try_again_after_handling_write_error(fd, len, r);
......@@ -151,17 +153,18 @@ toku_os_full_write (int fd, const void *buf, size_t len) {
int
toku_os_write (int fd, const void *buf, size_t len) {
const char *bp = (const char *) buf;
while (len > 0) {
ssize_t r;
if (t_write) {
r = t_write(fd, buf, len);
r = t_write(fd, bp, len);
} else {
r = write(fd, buf, len);
r = write(fd, bp, len);
}
if (r < 0)
return errno;
len -= r;
buf += r;
bp += r;
}
return 0;
}
......
......@@ -132,7 +132,7 @@ int toku_logger_open (const char *directory, TOKULOGGER logger) {
logger->next_log_file_number = nexti;
open_logfile(logger);
logger->is_open = 1;
logger->is_open = TRUE;
return 0;
}
......@@ -166,7 +166,7 @@ int toku_logger_close(TOKULOGGER *loggerp) {
r = ml_destroy(&logger->input_lock); if (r!=0) goto panic;
r = toku_pthread_mutex_destroy(&logger->output_condition_lock); if (r!=0) goto panic;
r = toku_pthread_cond_destroy(&logger->output_condition); if (r!=0) goto panic;
logger->is_panicked=1; // Just in case this might help.
logger->is_panicked=TRUE; // Just in case this might help.
if (logger->directory) toku_free(logger->directory);
toku_omt_destroy(&logger->live_txns);
toku_logfilemgr_destroy(&logger->logfilemgr);
......@@ -396,7 +396,7 @@ int toku_logger_fsync (TOKULOGGER logger)
void toku_logger_panic (TOKULOGGER logger, int err) {
logger->panic_errno=err;
logger->is_panicked=1;
logger->is_panicked=TRUE;
}
int toku_logger_panicked(TOKULOGGER logger) {
if (logger==0) return 0;
......
......@@ -65,7 +65,7 @@ int toku_txn_begin_with_xid (TOKUTXN parent_tokutxn, TOKUTXN *tokutxn, TOKULOGGE
result->rollentry_fd = -1;
result->rollentry_filesize = 0;
result->force_fsync_on_commit = FALSE;
result->has_done_work = 0;
result->has_done_work = FALSE;
*tokutxn = result;
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment