From: Michael Wallner Date: Wed, 22 Jan 2020 11:38:34 +0000 (+0100) Subject: move debug error logger into right place X-Git-Tag: pre_cmake~8 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=308d66cd759d7c1285550f5ca2a75cc32b74f146;p=awesomized%2Flibmemcached move debug error logger into right place --- diff --git a/libmemcached/error.cc b/libmemcached/error.cc index ab17926e..ced9d7a2 100644 --- a/libmemcached/error.cc +++ b/libmemcached/error.cc @@ -216,21 +216,20 @@ static void _set(Memcached& memc, memcached_string_t *str, memcached_return_t &r error->next= memc.error_messages; memc.error_messages= error; - } - #if 0 - if (error_log_fd == -1) - { -// unlink("/tmp/libmemcachd.log"); - if ((error_log_fd= open("/tmp/libmemcachd.log", O_CREAT | O_WRONLY | O_APPEND, 0644)) < 0) + if (error_log_fd == -1) { - perror("open"); - error_log_fd= -1; + // unlink("/tmp/libmemcachd.log"); + if ((error_log_fd= open("/tmp/libmemcachd.log", O_CREAT | O_WRONLY | O_APPEND, 0644)) < 0) + { + perror("open"); + error_log_fd= -1; + } } - } - ::write(error_log_fd, error->message, error->size); - ::write(error_log_fd, "\n", 1); + ::write(error_log_fd, error->message, error->size); + ::write(error_log_fd, "\n", 1); #endif + } } memcached_return_t memcached_set_error(Memcached& memc, memcached_return_t rc, const char *at, const char *str, size_t length)