X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcachedutil%2Fpid.cc;h=99f378d1656c76572472718467e9720cc46a444f;hb=e9c7a25491f4cf9265a926b7d9848bd70acaf7aa;hp=7ff665b646fc4a6bb594719070c6eb9160f4c8e1;hpb=bd53173d0a23c8c2a0dac68056cbd2cc52d5a6ef;p=m6w6%2Flibmemcached diff --git a/libmemcachedutil/pid.cc b/libmemcachedutil/pid.cc index 7ff665b6..99f378d1 100644 --- a/libmemcachedutil/pid.cc +++ b/libmemcachedutil/pid.cc @@ -48,11 +48,13 @@ pid_t libmemcached_util_getpid(const char *hostname, in_port_t port, memcached_r pid_t pid= -1; memcached_return_t unused; - if (not ret) + if (ret == NULL) + { ret= &unused; + } memcached_st *memc_ptr= memcached_create(NULL); - if (not memc_ptr) + if (memc_ptr == NULL) { *ret= MEMCACHED_MEMORY_ALLOCATION_FAILURE; return -1; @@ -72,8 +74,7 @@ pid_t libmemcached_util_getpid(const char *hostname, in_port_t port, memcached_r } else if (rc == MEMCACHED_SOME_ERRORS) // Generic answer, we will now find the specific reason (if one exists) { - memcached_server_instance_st instance= - memcached_server_instance_by_position(memc_ptr, 0); + memcached_server_instance_st instance= memcached_server_instance_by_position(memc_ptr, 0); assert_msg(instance and instance->error_messages, " "); if (instance and instance->error_messages)