From 697eeb716815c6bc8f020d0e1e60c0ec25a98e02 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Thu, 7 Aug 2014 00:54:03 +0200 Subject: [PATCH] ensure that the process initializer actually works by using it --- include/simgrid/platf.h | 2 +- src/simix/smx_deployment.c | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/include/simgrid/platf.h b/include/simgrid/platf.h index edcd3016ac..48b7eeaac4 100644 --- a/include/simgrid/platf.h +++ b/include/simgrid/platf.h @@ -317,7 +317,7 @@ typedef struct s_sg_platf_process_cbarg { e_surf_process_on_failure_t on_failure; } s_sg_platf_process_cbarg_t; -#define SG_PLATF_PROCESS_INITIALIZER {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL} +#define SG_PLATF_PROCESS_INITIALIZER {NULL,0,NULL,NULL,NULL,-1,-1,SURF_PROCESS_ON_FAILURE_DIE} typedef struct s_sg_platf_AS_cbarg *sg_platf_AS_cbarg_t; typedef struct s_sg_platf_AS_cbarg { diff --git a/src/simix/smx_deployment.c b/src/simix/smx_deployment.c index d1fcee1a94..5602ad6504 100644 --- a/src/simix/smx_deployment.c +++ b/src/simix/smx_deployment.c @@ -194,8 +194,7 @@ void SIMIX_process_set_function(const char *process_host, double process_start_time, double process_kill_time) { - s_sg_platf_process_cbarg_t process; - memset(&process,0,sizeof(process)); + s_sg_platf_process_cbarg_t process = SG_PLATF_PROCESS_INITIALIZER; smx_host_t host = SIMIX_host_get_by_name(process_host); if (!host) @@ -220,8 +219,6 @@ void SIMIX_process_set_function(const char *process_host, process.host = process_host; process.kill_time = process_kill_time; process.start_time = process_start_time; - process.on_failure = SURF_PROCESS_ON_FAILURE_DIE; - process.properties = NULL; sg_platf_new_process(&process); } -- 2.20.1