diff options
author | Jeremy Harris <jgh146exb@wizmail.org> | 2020-03-18 13:47:42 +0000 |
---|---|---|
committer | Jeremy Harris <jgh146exb@wizmail.org> | 2020-03-20 01:15:12 +0000 |
commit | 568092148bf6ade68174fa1ccf34b8c37d9064e9 (patch) | |
tree | b57958756160f60d9858759b0ba3945cb181ab60 /src/src/functions.h | |
parent | 3a2adc82d165fccae92f6a693ce5ddba10d371d4 (diff) |
consistent fork-time debug
Testcase issues: 0366 2035
Diffstat (limited to 'src/src/functions.h')
-rw-r--r-- | src/src/functions.h | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/src/src/functions.h b/src/src/functions.h index 9e71d0c20..a44e7a873 100644 --- a/src/src/functions.h +++ b/src/src/functions.h @@ -1117,13 +1117,31 @@ return NULL; static inline pid_t exim_fork(const unsigned char * purpose) { -pid_t pid = fork(); -if (pid == 0) process_purpose = purpose; +pid_t pid; +DEBUG(D_any) debug_printf("%s forking for %s\n", process_purpose, purpose); +if ((pid = fork()) == 0) + { + process_purpose = purpose; + DEBUG(D_any) debug_printf("postfork: %s\n", purpose); + } +else + { + testharness_pause_ms(100); /* let child work */ + DEBUG(D_any) debug_printf("%s forked for %s: %d\n", process_purpose, purpose, (int)pid); + } return pid; } -#define child_open_exim(p, r) child_open_exim_function((p), (r)) -#define child_open_exim2(p, s, a, r) child_open_exim2_function((p), (s), (a), (r)) + +static inline pid_t +child_open_exim(int * fdptr, const uschar * purpose) +{ return child_open_exim_function(fdptr, purpose); } + +static inline pid_t +child_open_exim2(int * fdptr, uschar * sender, + uschar * sender_auth, const uschar * purpose) +{ return child_open_exim2_function(fdptr, sender, sender_auth, purpose); } + /******************************************************************************/ #endif /* !MACRO_PREDEF */ |