Skip to content

Commit

Permalink
Better check for FDs in net2 bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Mar 31, 2010
1 parent da16128 commit aec80d4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/node_net2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ static Persistent<FunctionTemplate> recv_msg_template;


#define FD_ARG(a) \
if (!(a)->IsInt32()) { \
int fd; \
if (!(a)->IsInt32() || (fd = (a)->Int32Value()) < 0) { \
return ThrowException(Exception::TypeError( \
String::New("Bad file descriptor argument"))); \
} \
int fd = (a)->Int32Value();
}


static inline const char *errno_string(int errorno) {
Expand Down

0 comments on commit aec80d4

Please sign in to comment.