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:
Christian Helmuth
2012-11-15 12:53:32 +01:00
parent d23ee02e9a
commit 2995011b34
3 changed files with 56 additions and 15 deletions

View File

@ -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);
}
}