summaryrefslogtreecommitdiffstats
path: root/src/shared/sockhelper.c
diff options
context:
space:
mode:
authorSimon Rettberg2017-10-01 17:10:13 +0200
committerSimon Rettberg2017-10-01 17:10:13 +0200
commita814cf0795ed097fab01261e081aabbea5c4ca28 (patch)
tree3e0d74c35d1049359357eb02a6bdc21f5cdc490f /src/shared/sockhelper.c
parent[SERVER] Fix closing timeout reset, fix log messages (diff)
downloaddnbd3-a814cf0795ed097fab01261e081aabbea5c4ca28.tar.gz
dnbd3-a814cf0795ed097fab01261e081aabbea5c4ca28.tar.xz
dnbd3-a814cf0795ed097fab01261e081aabbea5c4ca28.zip
[*] constness for sock_sendAll params
Diffstat (limited to 'src/shared/sockhelper.c')
-rw-r--r--src/shared/sockhelper.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/shared/sockhelper.c b/src/shared/sockhelper.c
index 4a4563e..e511f0f 100644
--- a/src/shared/sockhelper.c
+++ b/src/shared/sockhelper.c
@@ -294,13 +294,13 @@ bool sock_append(poll_list_t *list, const int sock, bool wantRead, bool wantWrit
return true;
}
-ssize_t sock_sendAll(const int sock, void *buffer, const size_t len, int maxtries)
+ssize_t sock_sendAll(const int sock, const void *buffer, const size_t len, int maxtries)
{
size_t done = 0;
ssize_t ret = 0;
while ( done < len ) {
if ( maxtries >= 0 && --maxtries == -1 ) break;
- ret = send( sock, (char*)buffer + done, len - done, MSG_NOSIGNAL );
+ ret = send( sock, (const uint8_t*)buffer + done, len - done, MSG_NOSIGNAL );
if ( ret == -1 ) {
if ( errno == EINTR ) continue;
if ( errno == EAGAIN || errno == EWOULDBLOCK ) {