mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-19 07:38:28 +00:00
base-linux: implement IPC server destruction
When an IPC server is finalized two important things should happen: First, the association of the server socket with a capability must be invalidated. And finally, the server socket pair (server side and client side) must be closed. Related to #38.
This commit is contained in:
9
base-linux/src/base/env/platform_env.cc
vendored
9
base-linux/src/base/env/platform_env.cc
vendored
@ -14,9 +14,11 @@
|
||||
#include <util/arg_string.h>
|
||||
#include <base/platform_env.h>
|
||||
#include <base/thread.h>
|
||||
#include <linux_syscalls.h>
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
|
||||
/********************************
|
||||
** Platform_env::Local_parent **
|
||||
********************************/
|
||||
@ -124,4 +126,11 @@ namespace Genode {
|
||||
}
|
||||
return ncs;
|
||||
}
|
||||
|
||||
void destroy_server_socket_pair(Native_connection_state const &ncs)
|
||||
{
|
||||
/* close local file descriptor if it is valid */
|
||||
if (ncs.server_sd != -1) lx_close(ncs.server_sd);
|
||||
if (ncs.client_sd != -1) lx_close(ncs.client_sd);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user