Ack,
Mathi.

>-----Original Message-----
>From: Lennart Lund [mailto:[email protected]]
>Sent: Tuesday, June 03, 2014 8:47 PM
>To: [email protected]; Mathivanan Naickan Palanivelu
>Cc: [email protected]
>Subject: [PATCH 1 of 1] log: Cleanup some findings [#924]
>
> osaf/services/saf/logsv/lgs/lgs_file.c    |  4 ++--
> osaf/services/saf/logsv/lgs/lgs_filehdl.c |  1 -
>osaf/services/saf/logsv/lgs/lgs_stream.c  |  8 ++++++--
> 3 files changed, 8 insertions(+), 5 deletions(-)
>
>
>lgs_filehdl:
>make_log_dir_hdl()
>strncpy replaced by snprintf but the strncpy is not removed. Same thing done
>twice.
>
>lgs_file.c
>start_file_thread()
>The return variable is missing when calling pthread_cond_init()
>
>lgs_stream.c
>log_stream_write_h()
>Strange log text, "IN write 'saLogSystem_20140516_122220' failed "Success""
>
>diff --git a/osaf/services/saf/logsv/lgs/lgs_file.c
>b/osaf/services/saf/logsv/lgs/lgs_file.c
>--- a/osaf/services/saf/logsv/lgs/lgs_file.c
>+++ b/osaf/services/saf/logsv/lgs/lgs_file.c
>@@ -218,12 +218,12 @@ static int start_file_thread(void)
>               LOG_ER("pthread_mutex_init fail %s",strerror(errno));
>               goto done;
>       }
>-      pthread_cond_init (&request_cv,NULL);
>+      rc = pthread_cond_init (&request_cv,NULL);
>       if (rc != 0) {
>               LOG_ER("pthread_cond_init fail %s",strerror(errno));
>               goto done;
>       }
>-      pthread_cond_init (&answer_cv,NULL);
>+      rc = pthread_cond_init (&answer_cv,NULL);
>       if (rc != 0) {
>               LOG_ER("pthread_cond_init fail %s",strerror(errno));
>               goto done;
>diff --git a/osaf/services/saf/logsv/lgs/lgs_filehdl.c
>b/osaf/services/saf/logsv/lgs/lgs_filehdl.c
>--- a/osaf/services/saf/logsv/lgs/lgs_filehdl.c
>+++ b/osaf/services/saf/logsv/lgs/lgs_filehdl.c
>@@ -354,7 +354,6 @@ int make_log_dir_hdl(void *indata, void  #if 0
>               rootpath = PKGLOGDIR;
> #endif
>-              strncpy(out_path, rootpath, max_outsize);
>               n = snprintf(out_path, max_outsize, "%s", rootpath);
>               if (n >= max_outsize) {
>                       LOG_WA("Invalid root path > max_outsize"); diff --git
>a/osaf/services/saf/logsv/lgs/lgs_stream.c
>b/osaf/services/saf/logsv/lgs/lgs_stream.c
>--- a/osaf/services/saf/logsv/lgs/lgs_stream.c
>+++ b/osaf/services/saf/logsv/lgs/lgs_stream.c
>@@ -1243,8 +1243,12 @@ int log_stream_write_h(log_stream_t *str
>               /* If writing failed always invalidate the stream file 
> descriptor.
>                */
>               /* Careful with log level here to avoid syslog flooding */
>-              LOG_IN("write '%s' failed \"%s\"", stream->logFileCurrent,
>-                              strerror(write_errno));
>+              if (rc == -2) {
>+                      LOG_IN("write '%s' failed \"Timeout\"", stream-
>>logFileCurrent);
>+              } else {
>+                      LOG_IN("write '%s' failed \"%s\"", stream-
>>logFileCurrent,
>+                                      strerror(write_errno));
>+              }
>
>               if (*stream->p_fd != -1) {
>                       /* Try to close the file and invalidate the stream fd */

------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to