Close notifier socket before re-exec of daemon. Bug 2539
[exim.git] / src / exim_monitor / em_version.c
CommitLineData
059ec3d9
PH
1/*************************************************
2* Exim Monitor *
3*************************************************/
4
f9ba5e22 5/* Copyright (c) University of Cambridge 1995 - 2018 */
059ec3d9
PH
6/* See the file NOTICE for conditions of use and distribution. */
7
36eb5d3d
JH
8#define EM_VERSION_C
9
059ec3d9 10#include "mytypes.h"
e59797e3 11#include "store.h"
059ec3d9
PH
12#include "macros.h"
13#include <string.h>
14#include <stdlib.h>
15
a6f7862b
AM
16#include "version.h"
17
059ec3d9
PH
18extern uschar *version_string;
19extern uschar *version_date;
20
21void
22version_init(void)
23{
24int i = 0;
25uschar today[20];
26
f3f065bb 27version_string = US"2.06";
059ec3d9 28
a6f7862b
AM
29#ifdef EXIM_BUILD_DATE_OVERRIDE
30/* Reproducible build support; build tooling should have given us something looking like
31 * "25-Feb-2017 20:15:40" in EXIM_BUILD_DATE_OVERRIDE based on $SOURCE_DATE_EPOCH in environ
32 * per <https://reproducible-builds.org/specs/source-date-epoch/>
33 */
34version_date = US malloc(32);
35version_date[0] = 0;
36Ustrncat(version_date, EXIM_BUILD_DATE_OVERRIDE, 31);
37
38#else
f3ebb786 39Ustrcpy(today, US __DATE__);
059ec3d9
PH
40if (today[4] == ' ') i = 1;
41today[3] = today[6] = '-';
42
5903c6ff 43version_date = US malloc(32);
059ec3d9
PH
44version_date[0] = 0;
45Ustrncat(version_date, today+4+i, 3-i);
46Ustrncat(version_date, today, 4);
47Ustrncat(version_date, today+7, 4);
f3ebb786
JH
48Ustrcat(version_date, US" ");
49Ustrcat(version_date, US __TIME__);
a6f7862b 50#endif
059ec3d9
PH
51}
52
53/* End of em_version.c */