fixed a bug in killing a slave in the pro device
This commit is contained in:
parent
49ad401433
commit
a69d2401c0
@ -85,9 +85,9 @@ static MIO_INLINE int xdigit_to_num (mio_bch_t c)
|
|||||||
return MIO_XDIGIT_TO_NUM(c);
|
return MIO_XDIGIT_TO_NUM(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
static MIO_INLINE int push_to_buffer (mio_htrd_t* htrd, mio_htob_t* octb, const mio_bch_t* ptr, mio_oow_t len)
|
static MIO_INLINE int push_to_buffer (mio_htrd_t* htrd, mio_becs_t* octb, const mio_bch_t* ptr, mio_oow_t len)
|
||||||
{
|
{
|
||||||
if (mio_becs_ncat (octb, ptr, len) == (mio_oow_t)-1)
|
if (mio_becs_ncat(octb, ptr, len) == (mio_oow_t)-1)
|
||||||
{
|
{
|
||||||
htrd->errnum = MIO_HTRD_ENOMEM;
|
htrd->errnum = MIO_HTRD_ENOMEM;
|
||||||
return -1;
|
return -1;
|
||||||
@ -128,9 +128,9 @@ mio_htrd_t* mio_htrd_open (mio_t* mio, mio_oow_t xtnsize)
|
|||||||
mio_htrd_t* htrd;
|
mio_htrd_t* htrd;
|
||||||
|
|
||||||
htrd = (mio_htrd_t*)mio_allocmem(mio, MIO_SIZEOF(mio_htrd_t) + xtnsize);
|
htrd = (mio_htrd_t*)mio_allocmem(mio, MIO_SIZEOF(mio_htrd_t) + xtnsize);
|
||||||
if (htrd)
|
if (MIO_LIKELY(htrd))
|
||||||
{
|
{
|
||||||
if (mio_htrd_init(htrd, mio) <= -1)
|
if (MIO_UNLIKELY(mio_htrd_init(htrd, mio) <= -1))
|
||||||
{
|
{
|
||||||
mio_freemem (mio, htrd);
|
mio_freemem (mio, htrd);
|
||||||
return MIO_NULL;
|
return MIO_NULL;
|
||||||
@ -719,8 +719,8 @@ static mio_htb_pair_t* hdr_cbserter (
|
|||||||
val->len = tx->vlen;
|
val->len = tx->vlen;
|
||||||
val->next = MIO_NULL;
|
val->next = MIO_NULL;
|
||||||
|
|
||||||
p = mio_htb_allocpair (htb, kptr, klen, val, 0);
|
p = mio_htb_allocpair(htb, kptr, klen, val, 0);
|
||||||
if (p == MIO_NULL)
|
if (MIO_UNLIKELY(!p))
|
||||||
{
|
{
|
||||||
mio_freemem (htb->mio, val);
|
mio_freemem (htb->mio, val);
|
||||||
tx->htrd->errnum = MIO_HTRD_ENOMEM;
|
tx->htrd->errnum = MIO_HTRD_ENOMEM;
|
||||||
|
@ -522,7 +522,6 @@ static int dev_pro_kill_slave (mio_dev_t* dev, int force)
|
|||||||
/* the master pointer is not valid from this point onwards
|
/* the master pointer is not valid from this point onwards
|
||||||
* as the actual master device object is freed in mio_dev_kill() */
|
* as the actual master device object is freed in mio_dev_kill() */
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* this call is initiated by this slave device itself.
|
/* this call is initiated by this slave device itself.
|
||||||
@ -531,6 +530,7 @@ static int dev_pro_kill_slave (mio_dev_t* dev, int force)
|
|||||||
master->slave[rdev->id] = MIO_NULL;
|
master->slave[rdev->id] = MIO_NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (rdev->pfd != MIO_SYSHND_INVALID)
|
if (rdev->pfd != MIO_SYSHND_INVALID)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user