1
0
mirror of https://github.com/anope/anope.git synced 2026-07-10 04:23:13 +02:00

Update Send and Recv to use ssize_t instead of int.

This commit is contained in:
Sadie Powell
2024-11-25 16:14:17 +00:00
parent e42b4c21b7
commit 3cbac4bcea
6 changed files with 21 additions and 21 deletions
+1 -1
View File
@@ -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);
}
+5 -5
View File
@@ -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());
}
+1 -1
View File
@@ -55,7 +55,7 @@
#include "pipe/pipe.h"
#include "sigaction/sigaction.h"
typedef int ssize_t;
typedef SSIZE_T ssize_t;
namespace Anope
{