Ack

/Lennart

> -----Original Message-----
> From: ramesh.bet...@oracle.com [mailto:ramesh.bet...@oracle.com]
> Sent: den 2 maj 2014 09:06
> To: mathi.naic...@oracle.com; Lennart Lund
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: [PATCH 1 of 1] log: Log should not retry when close() returns EINTR
> [#147]
> 
>  osaf/services/saf/logsv/lgs/lgs_filehdl.c |  4 ----
> osaf/services/saf/logsv/lgs/lgs_stream.c  |  2 +-
>  2 files changed, 1 insertions(+), 5 deletions(-)
> 
> 
> In case of close(), the first thing Linux does is deallocate the file 
> descriptor;
> then it starts flushing pending written data. If this process is interrupted, 
> it
> will return EINTR, but the file descriptor itself is already deallocated, and 
> may
> have been reused long before close() returned. Hence it is not required to
> retry close().
> 
> 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
> @@ -482,12 +482,8 @@ int fileclose_hdl(void *indata, void *ou
>       fd = *(char *) indata;
>       TRACE_ENTER2("fd=%d", fd);
> 
> -close_retry:
>       rc = close(fd);
> 
> -     if (rc == -1 && errno == EINTR)
> -             goto close_retry;
> -
>       if (rc == -1) {
>               LOG_ER("fileclose() %s",strerror(errno));
>       }
> 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
> @@ -105,7 +105,7 @@ static int fileclose_h(int fd)
>       lgsf_retcode_t api_rc;
>       int rc = 0;
> 
> -     TRACE_ENTER();
> +     TRACE_ENTER2("fd=%d", fd);
> 
>       /* Fill in API structure */
>       apipar.req_code_in = LGSF_FILECLOSE;

------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
• 3 signs your SCM is hindering your productivity
• Requirements for releasing software faster
• Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to