fix eol, close sock on error, fix include

This commit is contained in:
Dave Murphy 2018-05-16 22:59:33 +01:00
parent c1ad26ca98
commit eb4933694b

View File

@ -1,4 +1,5 @@
#include <switch/runtime/nxlink.h> #include "runtime/nxlink.h"
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#include <sys/socket.h> #include <sys/socket.h>
@ -25,6 +26,7 @@ int nxlinkStdio()
ret = connect(sock, (struct sockaddr *) &srv_addr, sizeof(srv_addr)); ret = connect(sock, (struct sockaddr *) &srv_addr, sizeof(srv_addr));
if (ret != 0) { if (ret != 0) {
close(sock);
return -1; return -1;
} }