Skip to content
Snippets Groups Projects
Commit ab1c765b authored by rswindell's avatar rswindell
Browse files

Now uses 0 to signify invalid socket instead of INVALID_SOCKET (-1)

parent b2803a40
No related branches found
No related tags found
No related merge requests found
......@@ -91,14 +91,14 @@ static void js_finalize_socket(JSContext *cx, JSObject *obj)
sock=(uint)JS_GetPrivate(cx,obj)>>1;
if(sock==INVALID_SOCKET || sock==0)
if(sock==0)
return;
close_socket(sock);
dbprintf(FALSE, sock, "closed/deleted");
sock=INVALID_SOCKET;
sock=0; /* use zero to signify invalid socket */
JS_SetPrivate(cx, obj, (char*)(sock<<1));
}
......@@ -115,14 +115,14 @@ js_close(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
*rval = JSVAL_VOID;
if(sock==INVALID_SOCKET || sock==0)
if(sock==0)
return(JS_TRUE);
close_socket(sock);
dbprintf(FALSE, sock, "closed");
sock=INVALID_SOCKET;
sock=0; /* use zero to signify invalid socket */
JS_SetPrivate(cx, obj, (char*)(sock<<1));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment