From: yellows8 Date: Wed, 13 Apr 2016 04:36:47 +0000 (-0400) Subject: Updated udsConnectNetwork() to handle failure from the network-connection command... X-Git-Url: https://chaos.moe/g/?a=commitdiff_plain;h=6606a777192a3a2095fe51ad868c85c5ec774f4c;p=corbenik%2Fctrulib.git Updated udsConnectNetwork() to handle failure from the network-connection command properly, and removed the commented prints. --- diff --git a/libctru/source/services/uds.c b/libctru/source/services/uds.c index d1459aa..8d074dd 100644 --- a/libctru/source/services/uds.c +++ b/libctru/source/services/uds.c @@ -267,11 +267,9 @@ Result udsConnectNetwork(const udsNetworkStruct *network, const void *passphrase if(connection_type==UDSCONTYPE_Spectator)spectator=true; - //printf("connecting...\n");//Removing these prints caused connecting to fail. ret = udsipc_ConnectToNetwork(network, passphrase, passphrase_size, connection_type); - if(R_FAILED(ret))return ret; - //printf("bind...\n"); - if(context)ret = udsBind(context, recv_NetworkNodeID, spectator, data_channel); + + if(R_SUCCEEDED(ret) && context)ret = udsBind(context, recv_NetworkNodeID, spectator, data_channel); if(R_FAILED(ret))udsDisconnectNetwork();