diff --git a/common/common.h b/common/common.h index 48a8470..12e0abb 100755 --- a/common/common.h +++ b/common/common.h @@ -12,6 +12,10 @@ #include #include "exceptions/exceptions.h" +#ifndef EOK + #define EOK 0 +#endif + using namespace log4cxx; using namespace log4cxx::xml; using namespace log4cxx::helpers; diff --git a/server/pgnosqlserver.cpp b/server/pgnosqlserver.cpp index b0aaddc..a32e72b 100755 --- a/server/pgnosqlserver.cpp +++ b/server/pgnosqlserver.cpp @@ -182,6 +182,7 @@ int PgnosqlServer::run() char hbuf[NI_MAXHOST], sbuf[NI_MAXSERV]; in_len = sizeof in_addr; + errno=EOK; infd = accept (sfd, &in_addr, &in_len); if (infd == -1) { @@ -242,7 +243,7 @@ int PgnosqlServer::run() { ssize_t count; char buf[512]; - + errno=EOK; count = read (events[i].data.fd, buf, sizeof buf); if (count == -1) {