Bug #269

Updated by Madars over 6 years ago

Hi,
the function tpchkunsol not return the number of unsolicitted messages du to a problem in the return of the function.

as indicated in the help of the routine :

Upon successful completion, tpchkunsol() returns the number of unsolicited messages dispatched; otherwise it returns -1 and sets tperrno() to indicate the error condition.

if we check the source code of the function file (endurox/libatmi/atmi.c) we found that there is no return for the function ndrx_tpchkunsol:
<pre>


/**
* Check unsolicited messages by client
* @return FAIL
*/
expublic int tpchkunsol(void)
{
int ret=EXSUCCEED;
int entry_status=EXSUCCEED;
API_ENTRY;

if (EXSUCCEED!=entry_status)
{
EXFAIL_OUT(ret);
}


* if (ndrx_tpchkunsol()<0)*

{
NDRX_LOG(log_error, "ndrx_tpchkunsol failed");
EXFAIL_OUT(ret);
}

out:
return ret;
}
</pre>



as solution we can just get the return before check if the function fails or not :

<pre>


/**
* Check unsolicited messages by client
* @return FAIL
*/
expublic int tpchkunsol(void)
{
int ret=EXSUCCEED;
int entry_status=EXSUCCEED;
API_ENTRY;

if (EXSUCCEED!=entry_status)
{
EXFAIL_OUT(ret);
}
* ret = ndrx_tpchkunsol();*
if (ret<0)
{
NDRX_LOG(log_error, "ndrx_tpchkunsol failed");
EXFAIL_OUT(ret);
}

out:
return ret;
}
<pre>



Back