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:
+1
-1
@@ -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
@@ -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());
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
#include "pipe/pipe.h"
|
||||
#include "sigaction/sigaction.h"
|
||||
|
||||
typedef int ssize_t;
|
||||
typedef SSIZE_T ssize_t;
|
||||
|
||||
namespace Anope
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user