Commit d6785aef authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

reshGetStatus: applied patch from Kalle+Thomas.

parent bc6a8ad2
...@@ -3,6 +3,10 @@ ...@@ -3,6 +3,10 @@
* using CGRIBEX library version 1.9.1 * using CGRIBEX library version 1.9.1
* Version 1.9.5 released * Version 1.9.5 released
2018-07-02 Uwe Schulzweida
* reshGetStatus: applied patch from Kalle+Thomas
2018-05-31 Uwe Schulzweida 2018-05-31 Uwe Schulzweida
* Limit chunksizehint to filesize * Limit chunksizehint to filesize
......
...@@ -697,30 +697,29 @@ void reshSetStatus ( cdiResH resH, const resOps * ops, int status ) ...@@ -697,30 +697,29 @@ void reshSetStatus ( cdiResH resH, const resOps * ops, int status )
int reshGetStatus ( cdiResH resH, const resOps * ops ) int reshGetStatus ( cdiResH resH, const resOps * ops )
{ {
int nsp;
namespaceTuple_t nspT;
LIST_INIT(1); LIST_INIT(1);
LIST_LOCK(); LIST_LOCK();
nsp = namespaceGetActive (); int nsp = namespaceGetActive ();
nspT = namespaceResHDecode ( resH ); namespaceTuple_t nspT = namespaceResHDecode ( resH );
xassert ( nspT.nsp == nsp && xassert ( nspT.nsp == nsp &&
nspT.idx >= 0 && nspT.idx >= 0 );
nspT.idx < resHList[nsp].size );
int status = RESH_UNUSED;
if (nspT.idx < resHList[nsp].size)
{
listElem_t *listElem = resHList[nsp].resources + nspT.idx; listElem_t *listElem = resHList[nsp].resources + nspT.idx;
const resOps *elemOps = listElem->res.v.ops; const resOps *elemOps = listElem->res.v.ops;
xassert(listElem && (!(listElem->status & RESH_IN_USE_BIT) || elemOps == ops));
status = listElem->status;
}
LIST_UNLOCK(); LIST_UNLOCK();
xassert(listElem && (!(listElem->status & RESH_IN_USE_BIT) || elemOps == ops)); return status;
return listElem->status;
} }
/**************************************************************/ /**************************************************************/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment