X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fsrc%2Fspool_out.c;h=652506fb359c9d7b84df1b1f2ace9b03d0ab64fb;hb=60272099eb6529d6d748c7dd04412b35c09f37e2;hp=82b606871d225bd9a7ebb66ba2c7bf4a3fcd70ee;hpb=41313d92e0f157dacfa758993e7fc76e291b0415;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/spool_out.c b/src/src/spool_out.c index 82b606871..652506fb3 100644 --- a/src/src/spool_out.c +++ b/src/src/spool_out.c @@ -17,7 +17,7 @@ *************************************************/ /* This function is called immediately after errors in writing the spool, with -errno still set. It creates and error message, depending on the circumstances. +errno still set. It creates an error message, depending on the circumstances. If errmsg is NULL, it logs the message and panic-dies. Otherwise errmsg is set to point to the message, and -1 is returned. This function makes the code of spool_write_header() a bit neater. @@ -36,22 +36,21 @@ static int spool_write_error(int where, uschar **errmsg, uschar *s, uschar *temp_name, FILE *f) { -uschar *msg = (where == SW_RECEIVING)? - string_sprintf("spool file %s error while receiving from %s: %s", s, - (sender_fullhost != NULL)? sender_fullhost : sender_ident, - strerror(errno)) - : - string_sprintf("spool file %s error while %s: %s", s, - (where == SW_DELIVERING)? "delivering" : "modifying", - strerror(errno)); - -if (temp_name != NULL) Uunlink(temp_name); -if (f != NULL) (void)fclose(f); - -if (errmsg == NULL) - log_write(0, LOG_MAIN|LOG_PANIC_DIE, "%s", msg); -else +uschar *msg = where == SW_RECEIVING + ? string_sprintf("spool file %s error while receiving from %s: %s", s, + sender_fullhost ? sender_fullhost : sender_ident, + strerror(errno)) + : string_sprintf("spool file %s error while %s: %s", s, + where == SW_DELIVERING ? "delivering" : "modifying", + strerror(errno)); + +if (temp_name) Uunlink(temp_name); +if (f) (void)fclose(f); + +if (errmsg) *errmsg = msg; +else + log_write(0, LOG_MAIN|LOG_PANIC_DIE, "%s", msg); return -1; } @@ -379,7 +378,7 @@ if (close(fd) < 0) #endif /* NEED_SYNC_DIRECTORY */ /* Return the number of characters in the headers, which is the file size, less -the prelimary stuff, less the additional count fields on the headers. */ +the preliminary stuff, less the additional count fields on the headers. */ DEBUG(D_receive) debug_printf("Size of headers = %d\n", (int)(statbuf.st_size - size_correction));