This is an automated email from the ASF dual-hosted git repository. jpeach pushed a commit to branch master in repository https://git-dual.apache.org/repos/asf/trafficserver.git
commit e5257fc0bd72669bc90a88ec0391f8f6f6215d7a Author: James Peach <[email protected]> AuthorDate: Sat Nov 26 12:41:37 2016 -0800 Improve HostDB serialization warnings. --- iocore/hostdb/P_RefCountCacheSerializer.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/iocore/hostdb/P_RefCountCacheSerializer.h b/iocore/hostdb/P_RefCountCacheSerializer.h index 4004f37..853fd4e 100644 --- a/iocore/hostdb/P_RefCountCacheSerializer.h +++ b/iocore/hostdb/P_RefCountCacheSerializer.h @@ -168,7 +168,7 @@ RefCountCacheSerializer<C>::write_partition(int /* event */, Event *e) // Write the RefCountCacheItemMeta (as our header) int ret = this->write_to_disk((char *)&entry->meta, sizeof(entry->meta)); if (ret < 0) { - Warning("Error writing cache item header to %s: %d", this->tmp_filename.c_str(), ret); + Warning("Error writing cache item header to %s: %s", this->tmp_filename.c_str(), strerror(-ret)); delete this; return EVENT_DONE; } @@ -176,7 +176,7 @@ RefCountCacheSerializer<C>::write_partition(int /* event */, Event *e) // write the actual object now ret = this->write_to_disk((char *)entry->item.get(), entry->meta.size); if (ret < 0) { - Warning("Error writing cache item to %s: %d", this->tmp_filename.c_str(), ret); + Warning("Error writing cache item to %s: %s", this->tmp_filename.c_str(), strerror(-ret)); delete this; return EVENT_DONE; } @@ -229,8 +229,7 @@ RefCountCacheSerializer<C>::initialize_storage(int /* event */, Event *e) { this->fd = socketManager.open(this->tmp_filename.c_str(), O_TRUNC | O_RDWR | O_CREAT, 0644); // TODO: configurable perms if (this->fd == -1) { - Warning("Unable to create temporary file %s, unable to persist hostdb: %d :%s\n", this->tmp_filename.c_str(), this->fd, - strerror(errno)); + Warning("Unable to create temporary file %s, unable to persist hostdb: %s", this->tmp_filename.c_str(), strerror(errno)); delete this; return EVENT_DONE; } @@ -238,7 +237,7 @@ RefCountCacheSerializer<C>::initialize_storage(int /* event */, Event *e) // Write out the header int ret = this->write_to_disk((char *)&this->cache->get_header(), sizeof(RefCountCacheHeader)); if (ret < 0) { - Warning("Error writing cache header to %s: %d", this->tmp_filename.c_str(), ret); + Warning("Error writing cache header to %s: %s", this->tmp_filename.c_str(), strerror(-ret)); delete this; return EVENT_DONE; } @@ -314,7 +313,7 @@ RefCountCacheSerializer<C>::write_to_disk(const void *ptr, size_t n_bytes) while (written < n_bytes) { int ret = socketManager.write(this->fd, (char *)ptr + written, n_bytes - written); if (ret <= 0) { - return -1; + return ret; } else { written += ret; } -- To stop receiving notification emails like this one, please contact "[email protected]" <[email protected]>.
