{
case SP_COPYING:
/* confirm copying complete */
- if (GNUNET_OK != GNUNET_OS_process_status (d->pid, &type, &code))
+ if (GNUNET_OK != GNUNET_OS_process_status (d->proc, &type, &code))
{
if (GNUNET_TIME_absolute_get_remaining(d->max_timeout).rel_value == 0)
{
"gnunet-peerinfo", "gnunet-peerinfo", "-c", d->cfgfile,
"-sq");
#endif
- d->pid = GNUNET_OS_start_process (NULL, d->pipe_stdout, "gnunet-peerinfo",
+ d->proc = GNUNET_OS_start_process (NULL, d->pipe_stdout, "gnunet-peerinfo",
"gnunet-peerinfo",
"-c", d->cfgfile,
"-sq", NULL);
#endif
if (d->ssh_port_str == NULL)
{
- d->pid = GNUNET_OS_start_process (NULL, d->pipe_stdout, "ssh",
+ d->proc = GNUNET_OS_start_process (NULL, d->pipe_stdout, "ssh",
"ssh",
#if !DEBUG_TESTING
"-q",
}
else
{
- d->pid = GNUNET_OS_start_process (NULL, d->pipe_stdout, "ssh",
+ d->proc = GNUNET_OS_start_process (NULL, d->pipe_stdout, "ssh",
"ssh", "-p", d->ssh_port_str,
#if !DEBUG_TESTING
"-q",
GNUNET_DISK_pipe_close_end(d->pipe_stdout, GNUNET_DISK_PIPE_END_WRITE);
GNUNET_free (dst);
}
- if (-1 == d->pid)
+ if (NULL == d->proc)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("Could not start `%s' process to create hostkey.\n"),
d->cb = NULL;
GNUNET_DISK_pipe_close(d->pipe_stdout);
d->pipe_stdout = NULL;
- (void) PLIBC_KILL (d->pid, SIGKILL);
- GNUNET_break (GNUNET_OK == GNUNET_OS_process_wait (d->pid));
- d->pid = 0;
+ (void) GNUNET_OS_process_kill (d->proc, SIGKILL);
+ GNUNET_break (GNUNET_OK == GNUNET_OS_process_wait (d->proc));
+ GNUNET_OS_process_close (d->proc);
+ d->proc = NULL;
if (NULL != cb)
cb (d->cb_cls,
NULL,
}
GNUNET_DISK_pipe_close(d->pipe_stdout);
d->pipe_stdout = NULL;
- (void) PLIBC_KILL (d->pid, SIGKILL);
- GNUNET_break (GNUNET_OK == GNUNET_OS_process_wait (d->pid));
- d->pid = 0;
+ (void) GNUNET_OS_process_kill (d->proc, SIGKILL);
+ GNUNET_break (GNUNET_OK == GNUNET_OS_process_wait (d->proc));
+ GNUNET_OS_process_close (d->proc);
+ d->proc = NULL;
#if DEBUG_TESTING
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Successfully got hostkey!\n");
"-L", "DEBUG",
"-s");
#endif
- d->pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-arm",
+ d->proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-arm",
"gnunet-arm",
"-c", d->cfgfile,
#if DEBUG_TESTING
#endif
if (d->ssh_port_str == NULL)
{
- d->pid = GNUNET_OS_start_process (NULL, NULL, "ssh",
+ d->proc = GNUNET_OS_start_process (NULL, NULL, "ssh",
"ssh",
#if !DEBUG_TESTING
"-q",
else
{
- d->pid = GNUNET_OS_start_process (NULL, NULL, "ssh",
+ d->proc = GNUNET_OS_start_process (NULL, NULL, "ssh",
"ssh", "-p", d->ssh_port_str,
#if !DEBUG_TESTING
"-q",
}
GNUNET_free (dst);
}
- if (-1 == d->pid)
+ if (NULL == d->proc)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("Could not start `%s' process to start GNUnet.\n"),
&start_fsm, d);
break;
case SP_START_ARMING:
- if (GNUNET_OK != GNUNET_OS_process_status (d->pid, &type, &code))
+ if (GNUNET_OK != GNUNET_OS_process_status (d->proc, &type, &code))
{
if (GNUNET_TIME_absolute_get_remaining(d->max_timeout).rel_value == 0)
{
break;
case SP_SHUTDOWN_START:
/* confirm copying complete */
- if (GNUNET_OK != GNUNET_OS_process_status (d->pid, &type, &code))
+ if (GNUNET_OK != GNUNET_OS_process_status (d->proc, &type, &code))
{
if (GNUNET_TIME_absolute_get_remaining(d->max_timeout).rel_value == 0)
{
break;
case SP_CONFIG_UPDATE:
/* confirm copying complete */
- if (GNUNET_OK != GNUNET_OS_process_status (d->pid, &type, &code))
+ if (GNUNET_OK != GNUNET_OS_process_status (d->proc, &type, &code))
{
if (GNUNET_TIME_absolute_get_remaining(d->max_timeout).rel_value == 0) /* FIXME: config update should take timeout parameter! */
{
if (ret->ssh_port_str == NULL)
{
- ret->pid = GNUNET_OS_start_process (NULL, NULL, "scp",
+ ret->proc = GNUNET_OS_start_process (NULL, NULL, "scp",
"scp",
#if !DEBUG_TESTING
"-q",
}
else
{
- ret->pid = GNUNET_OS_start_process (NULL, NULL, "scp",
+ ret->proc = GNUNET_OS_start_process (NULL, NULL, "scp",
"scp", "-P", ret->ssh_port_str,
#if !DEBUG_TESTING
"-q",
ret->cfgfile, arg, NULL);
}
GNUNET_free (arg);
- if (-1 == ret->pid)
+ if (NULL == ret->proc)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_
else
arg = GNUNET_strdup (d->hostname);
- d->pid = GNUNET_OS_start_process (NULL, NULL, "ssh", "ssh",
+ d->proc = GNUNET_OS_start_process (NULL, NULL, "ssh", "ssh",
#if !DEBUG_TESTING
"-q",
#endif
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Stopping gnunet-arm with config `%s' locally.\n", d->cfgfile);
#endif
- d->pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-arm",
+ d->proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-arm",
"gnunet-arm",
#if DEBUG_TESTING
"-L", "DEBUG",
else
arg = GNUNET_strdup (d->hostname);
- d->pid = GNUNET_OS_start_process (NULL, NULL, "ssh", "ssh",
+ d->proc = GNUNET_OS_start_process (NULL, NULL, "ssh", "ssh",
#if !DEBUG_TESTING
"-q",
#endif
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Stopping gnunet-arm with config `%s' locally.\n", d->cfgfile);
#endif
- d->pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-arm",
+ d->proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-arm",
"gnunet-arm",
#if DEBUG_TESTING
"-L", "DEBUG",
GNUNET_asprintf (&arg, "%s@%s:%s", d->username, d->hostname, d->cfgfile);
else
GNUNET_asprintf (&arg, "%s:%s", d->hostname, d->cfgfile);
- d->pid = GNUNET_OS_start_process (NULL, NULL, "scp", "scp",
+ d->proc = GNUNET_OS_start_process (NULL, NULL, "scp", "scp",
#if !DEBUG_TESTING
"-q",
#endif
d->cfgfile, arg, NULL);
GNUNET_free (arg);
- if (-1 == d->pid)
+ if (NULL == d->proc)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_