projects
/
m6w6
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Bunch of fixes related to portability.
[m6w6/libmemcached]
/
lib
/
memcached_delete.c
diff --git
a/lib/memcached_delete.c
b/lib/memcached_delete.c
index 75087bd491b3c65a397ed798427fc920ae5c052b..8af154240478eb6245973238e6e492afd511f75a 100644
(file)
--- a/
lib/memcached_delete.c
+++ b/
lib/memcached_delete.c
@@
-26,20
+26,10
@@
memcached_return memcached_delete(memcached_st *ptr, char *key, size_t key_lengt
if (send_length >= MEMCACHED_DEFAULT_COMMAND_SIZE)
return MEMCACHED_WRITE_FAILURE;
if (send_length >= MEMCACHED_DEFAULT_COMMAND_SIZE)
return MEMCACHED_WRITE_FAILURE;
- sent_length=
write(ptr->hosts[server_key].fd, buffer, send_length
);
+ sent_length=
send(ptr->hosts[server_key].fd, buffer, send_length, 0
);
- if (sent_length == -1)
- {
- fprintf(stderr, "error %s: write: %m\n", __FUNCTION__);
+ if (sent_length == -1 || sent_length != send_length)
return MEMCACHED_WRITE_FAILURE;
return MEMCACHED_WRITE_FAILURE;
- }
-
- if (sent_length != send_length)
- {
- fprintf(stderr, "error %s: short write %d %d: %m\n",
- __FUNCTION__, sent_length, send_length);
- return MEMCACHED_WRITE_FAILURE;
- }
return memcached_response(ptr, buffer, MEMCACHED_DEFAULT_COMMAND_SIZE, server_key);
}
return memcached_response(ptr, buffer, MEMCACHED_DEFAULT_COMMAND_SIZE, server_key);
}