mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 12:32:40 +02:00
nxlink: only connect to host if a valid remote address has been set.
This commit is contained in:
parent
d90afaacde
commit
de9b357ff7
@ -7,8 +7,7 @@
|
|||||||
extern int __system_argc;
|
extern int __system_argc;
|
||||||
extern char** __system_argv;
|
extern char** __system_argv;
|
||||||
|
|
||||||
struct in_addr __nxlink_host;
|
struct in_addr __nxlink_host = { .s_addr = INADDR_NONE };
|
||||||
|
|
||||||
|
|
||||||
void nxlinkSetup(void)
|
void nxlinkSetup(void)
|
||||||
{
|
{
|
||||||
|
@ -11,6 +11,10 @@ static int sock = -1;
|
|||||||
|
|
||||||
int nxlinkConnectToHost(bool redirStdout, bool redirStderr)
|
int nxlinkConnectToHost(bool redirStdout, bool redirStderr)
|
||||||
{
|
{
|
||||||
|
if ((!redirStdout && !redirStderr) || __nxlink_host.s_addr == INADDR_NONE) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
struct sockaddr_in srv_addr;
|
struct sockaddr_in srv_addr;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user