Added cleanup for the external command stuff, so that the UNIX flavored

implementation can unlink the named pipe.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16145 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2006-01-30 01:13:48 +00:00
parent 64faaed88a
commit 51855db4b0
4 changed files with 18 additions and 0 deletions

View File

@ -11,6 +11,7 @@ extern "C" {
char *get_external_command(const char *prompt, char *input, int len);
void reply_to_external_command(int result);
void external_command_cleanup();
#ifdef __cplusplus
}

View File

@ -95,3 +95,10 @@ reply_to_external_command(int result)
}
}
}
void
external_command_cleanup()
{
// The port will be deleted automatically when the team exits.
}

View File

@ -166,3 +166,10 @@ reply_to_external_command(int result)
if (bytesWritten < 0)
close_client_connection();
}
void
external_command_cleanup()
{
unlink(kFSShellCommandSocketAddress);
}

View File

@ -2165,6 +2165,9 @@ do_fsh(void)
free(argv);
}
if (!sInteractiveMode)
external_command_cleanup();
if (feof(stdin))
printf("\n");