Re: [exim] exim dies on the interrupted system call

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Tony Finch
Date:  
À: Артём Каялайнен
CC: exim-users
Sujet: Re: [exim] exim dies on the interrupted system call
On Thu, 6 Jan 2011, Артём Каялайнен wrote:
>
> One question about the patch: how to get the value "name", which is passed to
> the function log_write.


Sorry, I failed to inline log_write_failed() correctly. Too much dirt in
my quick and dirty patch! Try this:


--- log.c    6 Jun 2010 00:27:52 -0000
+++ log.c    7 Jan 2011 18:10:06 -0000
@@ -886,8 +891,19 @@


     if ((rc = write(mainlogfd, log_buffer, length)) != length)
       {
-      log_write_failed(US"main log", length, rc);
-      /* That function does not return */
+      int save_errno = errno;
+
+      if (panic_save_buffer == NULL)
+        {
+        panic_save_buffer = (uschar *)malloc(LOG_BUFFER_SIZE);
+        if (panic_save_buffer != NULL)
+          memcpy(panic_save_buffer, log_buffer, LOG_BUFFER_SIZE);
+        }
+
+      log_write(0, LOG_PANIC_DIE, "failed to write to main log: length=%d result=%d "
+        "errno=%d (%s) st_mode=%x", length, rc, save_errno,
+        (save_errno == 0)? "write incomplete" : strerror(save_errno), statbuf.st_mode);
+      /* Never returns */
       }
     }
   }



Tony.
--
<fanf@???> <dot@???> http://dotat.at/ ${sg{\N${sg{\
N\}{([^N]*)(.)(.)(.*)}{\$1\$3\$2\$1\$3\n\$2\$3\$4\$3\n\$3\$2\$4}}\
\N}{([^N]*)(.)(.)(.*)}{\$1\$3\$2\$1\$3\n\$2\$3\$4\$3\n\$3\$2\$4}}