From: Robey Pointer Date: Thu, 26 Feb 2009 08:25:38 +0000 (+0100) Subject: Preserve errno for write failures X-Git-Tag: 0.27~25 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=c442af1afa9376ff660008f82b6217e577a36a73;p=awesomized%2Flibmemcached Preserve errno for write failures --- diff --git a/libmemcached/memcached_io.c b/libmemcached/memcached_io.c index ffbd6806..72a02a0f 100644 --- a/libmemcached/memcached_io.c +++ b/libmemcached/memcached_io.c @@ -338,6 +338,7 @@ static ssize_t io_flush(memcached_server_st *ptr, if ((sent_length= write(ptr->fd, local_write_ptr, write_length)) == -1) { + ptr->cached_errno= errno; switch (errno) { case ENOBUFS: @@ -355,7 +356,6 @@ static ssize_t io_flush(memcached_server_st *ptr, } default: memcached_quit_server(ptr, 1); - ptr->cached_errno= errno; *error= MEMCACHED_ERRNO; return -1; }