Ack, Mathi. > -----Original Message----- > From: Vu Minh Nguyen [mailto:[email protected]] > Sent: Monday, May 04, 2015 4:30 PM > To: Mathivanan Naickan Palanivelu > Cc: [email protected] > Subject: [PATCH 1 of 1] LOG: log_stream_config_change() renames files > successfully, but makes return (-1) [#1366] > > osaf/services/saf/logsv/lgs/lgs_stream.c | 6 +++++- > 1 files changed, 5 insertions(+), 1 deletions(-) > > > Callers will invoke log_stream_config_chang() @ lgs_stream.c in two cases: > 1. Request for old file closing and creating new files if create_files_f > parameter sets to TRUE. > 2. Just request for closing old files if create_files_f parameter sets to > FALSE. > > In second case, that is correct to have fd closed (-1). > So, make a value-returned judgment based on fd for all cases is not suitabe. > > 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 > @@ -1507,7 +1507,11 @@ int log_stream_config_change(bool create > *stream->p_fd = log_file_open(stream, stream- > >logFileCurrent,NULL); > } > > - if (*stream->p_fd == -1) { > + /* Fix bug - this function makes return (-1) when create_files_f = > false */ > + if (create_files_f == !LGS_STREAM_CREATE_FILES){ > + rc = 0; > + } > + else if (*stream->p_fd == -1) { > rc = -1; > } else { > rc = 0;
------------------------------------------------------------------------------ One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y _______________________________________________ Opensaf-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensaf-devel
