On Mon, Jan 2, 2017 at 3:41 AM, Christophe Milard <[email protected]> wrote: > The call the the cleanup_files() function (which cleans up possible > remaining file(s) from a defunc OPD with same pid) may use ODP_DBG and > ODP_ERR functions, but is (before this patch) placed before these ODP_* > functions are initialized. > This would surely sigfault. > The call the the cleanup_files() function is hence placed after ODP_DBG and > ODP_ERR function initialization to avoid this situation. > > Signed-off-by: Christophe Milard <[email protected]>
Reviewed-by: Bill Fischofer <[email protected]> > --- > platform/linux-generic/odp_init.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/platform/linux-generic/odp_init.c > b/platform/linux-generic/odp_init.c > index 1b0d8f8..06c6143 100644 > --- a/platform/linux-generic/odp_init.c > +++ b/platform/linux-generic/odp_init.c > @@ -73,7 +73,6 @@ int odp_init_global(odp_instance_t *instance, > > memset(&odp_global_data, 0, sizeof(struct odp_global_data_s)); > odp_global_data.main_pid = getpid(); > - cleanup_files(_ODP_TMPDIR, odp_global_data.main_pid); > > enum init_stage stage = NO_INIT; > odp_global_data.log_fn = odp_override_log; > @@ -86,6 +85,8 @@ int odp_init_global(odp_instance_t *instance, > odp_global_data.abort_fn = params->abort_fn; > } > > + cleanup_files(_ODP_TMPDIR, odp_global_data.main_pid); > + > if (odp_cpumask_init_global(params)) { > ODP_ERR("ODP cpumask init failed.\n"); > goto init_failed; > -- > 2.7.4 >
