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 */
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel