[exim] Patch to fix fclose() errors?

Pàgina inicial
Delete this message
Reply to this message
Autor: Exim Mailing List
Data:  
A: exim-users
Assumpte: [exim] Patch to fix fclose() errors?
Hi,

We're running Exim under Solaris 8 on Sparc hardware, and for a long
time (at least since 4.x was released if I recall) we have always
had random entries in our panic logs of:

2006-08-02 09:54:29 daemon: fclose(smtp_out) failed: Broken pipe
2006-08-02 09:54:29 daemon: fclose(smtp_out) failed: Broken pipe
2006-08-02 09:54:36 daemon: fclose(smtp_out) failed: Broken pipe

We would get 30 to 40 of these every day across all of our servers
running Solaris.

I don't know if this is the _proper_ fix or not (against 4.63 source),
but it finally made these errors go away. I did find the following
text in the Solaris man page on socket():

A SIGPIPE signal is raised if a process sends on a broken stream;
this causes naive processes, which do not handle the signal, to exit.

Not sure if this is somehow related to this error, but thought I would
mention it if related.

*** daemon.c.orig    Wed Aug  2 10:47:03 2006
--- daemon.c    Wed Aug  2 10:50:09 2006
***************
*** 686,692 ****


  if (smtp_out != NULL)
    {
!   if (fclose(smtp_out) != 0 && errno != ECONNRESET)
      log_write(0, LOG_MAIN|LOG_PANIC, "daemon: fclose(smtp_out) failed: %s",
        strerror(errno));
    smtp_out = NULL;
--- 686,692 ----


  if (smtp_out != NULL)
    {
!   if (fclose(smtp_out) != 0 && errno != ECONNRESET && errno != EPIPE)
      log_write(0, LOG_MAIN|LOG_PANIC, "daemon: fclose(smtp_out) failed: %s",
        strerror(errno));
    smtp_out = NULL;
***************
*** 695,701 ****


  if (smtp_in != NULL)
    {
!   if (fclose(smtp_in) != 0 && errno != ECONNRESET)
      log_write(0, LOG_MAIN|LOG_PANIC, "daemon: fclose(smtp_in) failed: %s",
        strerror(errno));
    smtp_in = NULL;
--- 695,701 ----


  if (smtp_in != NULL)
    {
!   if (fclose(smtp_in) != 0 && errno != ECONNRESET && errno != EPIPE)
      log_write(0, LOG_MAIN|LOG_PANIC, "daemon: fclose(smtp_in) failed: %s",
        strerror(errno));
    smtp_in = NULL;


Regards,

Dean Brooks
dean@???