parent
abf3867d39
commit
d46c79b428
|
@ -142,15 +142,13 @@ namespace {
|
||||||
}
|
}
|
||||||
Genode::memset(_buffer, 0, PIPE_BUF_SIZE);
|
Genode::memset(_buffer, 0, PIPE_BUF_SIZE);
|
||||||
|
|
||||||
_lock_state = (Genode::Cancelable_lock::State*)
|
_lock_state = new (Genode::env()->heap())
|
||||||
malloc(sizeof(Genode::Cancelable_lock::State));
|
Genode::Cancelable_lock::State(Genode::Lock::LOCKED);
|
||||||
|
|
||||||
if (!_lock_state) {
|
if (!_lock_state) {
|
||||||
PERR("pipe lock_state allocation failed");
|
PERR("pipe lock_state allocation failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
*_lock_state = Genode::Lock::LOCKED;
|
|
||||||
|
|
||||||
_lock = new (Genode::env()->heap()) Genode::Lock(*_lock_state);
|
_lock = new (Genode::env()->heap()) Genode::Lock(*_lock_state);
|
||||||
if (!_lock) {
|
if (!_lock) {
|
||||||
PERR("pipe lock allocation failed");
|
PERR("pipe lock allocation failed");
|
||||||
|
@ -173,7 +171,7 @@ namespace {
|
||||||
context(_partner)->set_partner(0);
|
context(_partner)->set_partner(0);
|
||||||
} else {
|
} else {
|
||||||
/* partner fd is already destroyed -> free shared resources */
|
/* partner fd is already destroyed -> free shared resources */
|
||||||
destroy(Genode::env()->heap(), _buffer);
|
free(_buffer);
|
||||||
destroy(Genode::env()->heap(), _lock);
|
destroy(Genode::env()->heap(), _lock);
|
||||||
destroy(Genode::env()->heap(), _lock_state);
|
destroy(Genode::env()->heap(), _lock_state);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user