Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

Commit

Permalink
safer usage of errno
Browse files Browse the repository at this point in the history
  • Loading branch information
yetkinozturk committed Jul 21, 2014
1 parent 1347923 commit c4d379e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions common/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
#include <log4cxx/propertyconfigurator.h>
#include "exceptions/exceptions.h"

#ifndef EOK
#define EOK 0
#endif

using namespace log4cxx;
using namespace log4cxx::xml;
using namespace log4cxx::helpers;
Expand Down
3 changes: 2 additions & 1 deletion server/pgnosqlserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit c4d379e

Please sign in to comment.