- system = GNUNET_malloc (sizeof (struct GNUNET_TESTING_System));
- if (NULL == (system->tmppath = getenv ("GNUNET_TESTING_PREFIX")))
+ system = GNUNET_new (struct GNUNET_TESTING_System);
+ if (NULL == (system->tmppath = getenv (GNUNET_TESTING_PREFIX)))
ss->sname = GNUNET_strdup (tss.service);
ss->cfg = GNUNET_CONFIGURATION_create ();
GNUNET_CONFIGURATION_iterate_section_values (tss.cfg, ss->sname,
&cfg_copy_iterator, ss->cfg);
GNUNET_CONFIGURATION_iterate_section_values (tss.cfg, "TESTING",
&cfg_copy_iterator, ss->cfg);
ss->sname = GNUNET_strdup (tss.service);
ss->cfg = GNUNET_CONFIGURATION_create ();
GNUNET_CONFIGURATION_iterate_section_values (tss.cfg, ss->sname,
&cfg_copy_iterator, ss->cfg);
GNUNET_CONFIGURATION_iterate_section_values (tss.cfg, "TESTING",
&cfg_copy_iterator, ss->cfg);
GNUNET_free (binary);
i->proc = GNUNET_OS_start_process (PIPE_CONTROL,
GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
GNUNET_free (binary);
i->proc = GNUNET_OS_start_process (PIPE_CONTROL,
GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
LOG (GNUNET_ERROR_TYPE_WARNING,
"Killing shared service instance (%s) failed\n", i->ss->sname);
(void) GNUNET_OS_process_wait (i->proc);
LOG (GNUNET_ERROR_TYPE_WARNING,
"Killing shared service instance (%s) failed\n", i->ss->sname);
(void) GNUNET_OS_process_wait (i->proc);
* key; if NULL, GNUNET_SYSERR is returned immediately
* @return NULL on error (not enough keys)
*/
* key; if NULL, GNUNET_SYSERR is returned immediately
* @return NULL on error (not enough keys)
*/
GNUNET_TESTING_hostkey_get (const struct GNUNET_TESTING_System *system,
uint32_t key_number,
struct GNUNET_PeerIdentity *id)
{
GNUNET_TESTING_hostkey_get (const struct GNUNET_TESTING_System *system,
uint32_t key_number,
struct GNUNET_PeerIdentity *id)
{
memcpy (private_key,
system->hostkeys_data +
(key_number * GNUNET_TESTING_HOSTKEYFILESIZE),
GNUNET_TESTING_HOSTKEYFILESIZE);
memcpy (private_key,
system->hostkeys_data +
(key_number * GNUNET_TESTING_HOSTKEYFILESIZE),
GNUNET_TESTING_HOSTKEYFILESIZE);
ss = system->shared_services[cnt];
ss_instances[cnt] = associate_shared_service (system, ss, cfg);
if (NULL == ss_instances[cnt])
ss = system->shared_services[cnt];
ss_instances[cnt] = associate_shared_service (system, ss, cfg);
if (NULL == ss_instances[cnt])
(cfg, "PATHS", "DEFAULTCONFIG", &config_filename));
if (GNUNET_OK != GNUNET_CONFIGURATION_write (cfg, config_filename))
{
(cfg, "PATHS", "DEFAULTCONFIG", &config_filename));
if (GNUNET_OK != GNUNET_CONFIGURATION_write (cfg, config_filename))
{
peer->ss_instances = ss_instances;
peer->cfgfile = config_filename; /* Free in peer_destroy */
peer->cfg = GNUNET_CONFIGURATION_dup (cfg);
peer->ss_instances = ss_instances;
peer->cfgfile = config_filename; /* Free in peer_destroy */
peer->cfg = GNUNET_CONFIGURATION_dup (cfg);
- peer->main_process = GNUNET_OS_start_process (PIPE_CONTROL,
- GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
- NULL, NULL,
- peer->main_binary,
- peer->main_binary,
- peer->args,
- "-c",
- peer->cfgfile,
- NULL);
+ peer->main_binary = GNUNET_CONFIGURATION_expand_dollar (peer->cfg, peer->main_binary);
+ peer->main_process = GNUNET_OS_start_process_s (PIPE_CONTROL,
+ GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ NULL,
+ peer->main_binary,
+ peer->args,
+ "-c",
+ peer->cfgfile,
+ NULL);
if (NULL == peer->main_process)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
if (NULL == peer->main_process)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,