(libT) #5293 'Wrong error codes used in upnp.c': patch by rb07
This commit is contained in:
parent
303353e55a
commit
bb05b943e9
|
@ -90,19 +90,19 @@ tr_upnpClose (tr_upnp * handle)
|
||||||
static struct UPNPDev *
|
static struct UPNPDev *
|
||||||
tr_upnpDiscover (int msec)
|
tr_upnpDiscover (int msec)
|
||||||
{
|
{
|
||||||
int err = 0;
|
|
||||||
struct UPNPDev * ret = NULL;
|
struct UPNPDev * ret = NULL;
|
||||||
|
int err = UPNPDISCOVER_SUCCESS;
|
||||||
|
|
||||||
#if defined (HAVE_MINIUPNP_16)
|
#if defined (HAVE_MINIUPNP_16)
|
||||||
ret = upnpDiscover (msec, NULL, NULL, 0, 0, &err);
|
ret = upnpDiscover (msec, NULL, NULL, 0, 0, &err);
|
||||||
#elif defined (HAVE_MINIUPNP_15)
|
#elif defined (HAVE_MINIUPNP_15)
|
||||||
ret = upnpDiscover (msec, NULL, NULL, 0);
|
ret = upnpDiscover (msec, NULL, NULL, 0);
|
||||||
#else
|
#else
|
||||||
ret = UPNPCOMMAND_UNKNOWN_ERROR;
|
ret = UPNPDISCOVER_UNKNOWN_ERROR;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (ret != UPNPCOMMAND_SUCCESS)
|
if (err != UPNPDISCOVER_SUCCESS)
|
||||||
tr_logAddNamedDbg (getKey (), "upnpDiscover failed (errno %d - %s)", err, tr_strerror (err));
|
tr_logAddNamedDbg (getKey (), "upnpDiscover failed (errno %d - %s)", errno, tr_strerror (errno));
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue