* Stop/kill a command.
*
* @param cmd handle to the process
- * @param type status type
- * @param code return code/signal number
- * @return GNUNET_OK on success, GNUNET_NO if we killed the process
*/
-int
-GNUNET_OS_command_stop (struct GNUNET_OS_CommandHandle *cmd,
- enum GNUNET_OS_ProcessStatusType *type,
- unsigned long *code);
+void
+GNUNET_OS_command_stop (struct GNUNET_OS_CommandHandle *cmd);
/**
const char *line)
{
struct GNUNET_NAT_MiniHandle *mini = cls;
- enum GNUNET_OS_ProcessStatusType type;
- unsigned long code;
if (NULL == line)
{
- GNUNET_OS_command_stop (mini->refresh_cmd,
- &type, &code);
+ GNUNET_OS_command_stop (mini->refresh_cmd);
mini->refresh_cmd = NULL;
mini->refresh_task = GNUNET_SCHEDULER_add_delayed (MAP_REFRESH_FREQ,
&do_refresh,
const char *line)
{
struct GNUNET_NAT_MiniHandle *mini = cls;
- enum GNUNET_OS_ProcessStatusType type;
- unsigned long code;
const char *ipaddr;
char *ipa;
const char *pstr;
if (NULL == line)
{
- GNUNET_OS_command_stop (mini->map_cmd,
- &type, &code);
+ GNUNET_OS_command_stop (mini->map_cmd);
mini->map_cmd = NULL;
if (mini->did_map == GNUNET_YES)
mini->refresh_task = GNUNET_SCHEDULER_add_delayed (MAP_REFRESH_FREQ,
const char *line)
{
struct GNUNET_NAT_MiniHandle *mini = cls;
- enum GNUNET_OS_ProcessStatusType type;
- unsigned long code;
if (NULL == line)
{
- GNUNET_OS_command_stop (mini->unmap_cmd,
- &type, &code);
+ GNUNET_OS_command_stop (mini->unmap_cmd);
mini->unmap_cmd = NULL;
GNUNET_free (mini);
return;
GNUNET_NAT_mini_map_stop (struct GNUNET_NAT_MiniHandle *mini)
{
char pstr[6];
- enum GNUNET_OS_ProcessStatusType type;
- unsigned long code;
if (! mini->did_map)
{
if (mini->map_cmd != NULL)
{
- GNUNET_OS_command_stop (mini->map_cmd,
- &type, &code);
+ GNUNET_OS_command_stop (mini->map_cmd);
mini->map_cmd = NULL;
}
GNUNET_free (mini);
}
if (mini->refresh_cmd != NULL)
{
- GNUNET_OS_command_stop (mini->refresh_cmd,
- &type, &code);
+ GNUNET_OS_command_stop (mini->refresh_cmd);
mini->refresh_cmd = NULL;
}
mini->ac (mini->ac_cls, GNUNET_NO,
#define VERBOSE GNUNET_YES
-
/* Time to wait before stopping NAT, in seconds */
-#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60)
-
-
-
-
+#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
/**
* Function called on each address that the NAT service
* from an independent task (not within the line processor).
*
* @param cmd handle to the process
- * @param type status type
- * @param code return code/signal number
- * @return GNUNET_OK on success, GNUNET_NO if we killed the process
*/
-int
-GNUNET_OS_command_stop (struct GNUNET_OS_CommandHandle *cmd,
- enum GNUNET_OS_ProcessStatusType *type,
- unsigned long *code)
+void
+GNUNET_OS_command_stop (struct GNUNET_OS_CommandHandle *cmd)
{
int killed;
}
killed = GNUNET_OS_process_kill (cmd->eip, SIGKILL);
GNUNET_break (GNUNET_OK ==
- GNUNET_OS_process_status (cmd->eip,
- type, code));
+ GNUNET_OS_process_wait (cmd->eip));
GNUNET_OS_process_close (cmd->eip);
GNUNET_DISK_pipe_close (cmd->opipe);
GNUNET_free (cmd);
- if (GNUNET_OK == killed)
- return GNUNET_NO;
- return GNUNET_OK;
}