osaf/libs/core/mds/mds_log.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


calling tzset() in log_mds() for each log is creating a lot of overhead in MDS 
logging,
taking locks, reading from file etc. This seems unnecessary just for supporting 
changed
time zones which should be a very rare and one time event so  The tzset() call 
can be moved
to mds_log_init() from log_mds().

diff --git a/osaf/libs/core/mds/mds_log.c b/osaf/libs/core/mds/mds_log.c
--- a/osaf/libs/core/mds/mds_log.c
+++ b/osaf/libs/core/mds/mds_log.c
@@ -76,6 +76,7 @@ uint32_t mds_log_init(char *log_file_nam
 {
        FILE *fh;
        memset(process_name, 0, MDS_MAX_PROCESS_NAME_LEN);
+       tzset();
        get_process_name();     
 
        if (lf != NULL)
@@ -223,7 +224,6 @@ static void log_mds(const char *str)
                int i;
 
                gettimeofday(&tv, NULL);
-               tzset();
                tstamp_data = localtime_r(&tv.tv_sec, &tm_info);
                osafassert(tstamp_data);
 

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to