Hi Vu This is not thread safe. This API can be called from more than one client thread (but not with same handle)
Thanks Lennart > -----Original Message----- > From: Vu Minh Nguyen [mailto:[email protected]] > Sent: den 15 april 2016 06:21 > To: [email protected]; Lennart Lund > Cc: [email protected] > Subject: [PATCH 1 of 1] log: fix incorrect time output [#1764] > > osaf/libs/agents/saf/lga/lga_api.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > > If timestamp (`logTimeStamp`) is not provided log client, log agent > will get the current time when getting the write log record request > and store the address, pointing to time holder variable, to `logTimeStamp`. > > But the time holder variable was an local variable in function > `handle_log_record`, > then when exiting the function `handle_log_record`, the time holder > variable's content will be deleted. > So, the original time data is unknown after the calling. > > This patch fix the problem by setting the holder variable as static. > > diff --git a/osaf/libs/agents/saf/lga/lga_api.c > b/osaf/libs/agents/saf/lga/lga_api.c > --- a/osaf/libs/agents/saf/lga/lga_api.c > +++ b/osaf/libs/agents/saf/lga/lga_api.c > @@ -960,7 +960,7 @@ static SaAisErrorT handle_log_record(con > lgsv_write_log_async_req_t *write_param) > { > SaAisErrorT ais_rc = SA_AIS_OK; > - SaTimeT logTimeStamp; > + static SaTimeT logTimeStamp; > > TRACE_ENTER(); > ------------------------------------------------------------------------------ Find and fix application performance issues faster with Applications Manager Applications Manager provides deep performance insights into multiple tiers of your business applications. It resolves application problems quickly and reduces your MTTR. Get your free trial! https://ad.doubleclick.net/ddm/clk/302982198;130105516;z _______________________________________________ Opensaf-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensaf-devel
