(libT) #5293 'Wrong error codes used in upnp.c': second patch from rb07 to handle older versions of miniupnpc
This commit is contained in:
parent
a2ce709d8c
commit
c32e4cdde1
|
@ -91,17 +91,16 @@ static struct UPNPDev *
|
|||
tr_upnpDiscover (int msec)
|
||||
{
|
||||
struct UPNPDev * ret = NULL;
|
||||
int err = UPNPDISCOVER_SUCCESS;
|
||||
|
||||
#if defined (HAVE_MINIUPNP_16)
|
||||
int err = UPNPDISCOVER_SUCCESS;
|
||||
ret = upnpDiscover (msec, NULL, NULL, 0, 0, &err);
|
||||
if (err != UPNPDISCOVER_SUCCESS)
|
||||
#elif defined (HAVE_MINIUPNP_15)
|
||||
ret = upnpDiscover (msec, NULL, NULL, 0);
|
||||
#else
|
||||
ret = UPNPDISCOVER_UNKNOWN_ERROR;
|
||||
if (ret == NULL)
|
||||
#endif
|
||||
|
||||
if (err != UPNPDISCOVER_SUCCESS)
|
||||
tr_logAddNamedDbg (getKey (), "upnpDiscover failed (errno %d - %s)", errno, tr_strerror (errno));
|
||||
|
||||
return ret;
|
||||
|
|
Loading…
Reference in New Issue