summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2024-11-25 16:14:17 +0000
committerSadie Powell <sadie@witchery.services>2024-11-25 16:14:17 +0000
commit3cbac4bcea7401b081f0e3e2d2d6dc94fe50ef15 (patch)
tree132b58ae4a42d11d636de659eb4d73dfb6672edc /src
parente42b4c21b7a317170cd1d2b41b2f6a1a837de041 (diff)
Update Send and Recv to use ssize_t instead of int.
Diffstat (limited to 'src')
-rw-r--r--src/pipeengine.cpp2
-rw-r--r--src/sockets.cpp10
-rw-r--r--src/win32/anope_windows.h2
3 files changed, 7 insertions, 7 deletions
diff --git a/src/pipeengine.cpp b/src/pipeengine.cpp
index 9b55134fb..6a5b57db6 100644
--- a/src/pipeengine.cpp
+++ b/src/pipeengine.cpp
@@ -60,7 +60,7 @@ void Pipe::Write(const char *data, size_t sz)
write(this->write_pipe, data, sz);
}
-int Pipe::Read(char *data, size_t sz)
+ssize_t Pipe::Read(char *data, size_t sz)
{
return read(this->GetFD(), data, sz);
}
diff --git a/src/sockets.cpp b/src/sockets.cpp
index 6d6718547..9bf78b1f9 100644
--- a/src/sockets.cpp
+++ b/src/sockets.cpp
@@ -426,23 +426,23 @@ size_t cidr::hash::operator()(const cidr &s) const
}
}
-int SocketIO::Recv(Socket *s, char *buf, size_t sz)
+ssize_t SocketIO::Recv(Socket *s, char *buf, size_t sz)
{
- int i = recv(s->GetFD(), buf, sz, 0);
+ ssize_t i = recv(s->GetFD(), buf, sz, 0);
if (i > 0)
TotalRead += i;
return i;
}
-int SocketIO::Send(Socket *s, const char *buf, size_t sz)
+ssize_t SocketIO::Send(Socket *s, const char *buf, size_t sz)
{
- int i = send(s->GetFD(), buf, sz, 0);
+ ssize_t i = send(s->GetFD(), buf, sz, 0);
if (i > 0)
TotalWritten += i;
return i;
}
-int SocketIO::Send(Socket *s, const Anope::string &buf)
+ssize_t SocketIO::Send(Socket *s, const Anope::string &buf)
{
return this->Send(s, buf.c_str(), buf.length());
}
diff --git a/src/win32/anope_windows.h b/src/win32/anope_windows.h
index 87eaff2a9..1b7e01915 100644
--- a/src/win32/anope_windows.h
+++ b/src/win32/anope_windows.h
@@ -55,7 +55,7 @@
#include "pipe/pipe.h"
#include "sigaction/sigaction.h"
-typedef int ssize_t;
+typedef SSIZE_T ssize_t;
namespace Anope
{