From f06f948ded2c197db314e6c8a4413bc58013cfce Mon Sep 17 00:00:00 2001 From: Liviu Chircu Date: Mon, 6 May 2019 17:02:28 +0300 Subject: [PATCH] Fix build on CentOS 6.x Reported by Nick Altmann --- cfg_pp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cfg_pp.c b/cfg_pp.c index a30179d1cb8..2aa43e8966e 100644 --- a/cfg_pp.c +++ b/cfg_pp.c @@ -507,7 +507,7 @@ static FILE *exec_preprocessor(FILE *flat_cfg, const char *preproc_cmdline) ssize_t left, written, total = 0; size_t bytes; char *p, *tok, *cmd, **argv = NULL, *pp_binary = NULL; - int argv_len = 0, ch, result; + int argv_len = 0, ch; if (strlen(preproc_cmdline) == 0) { LM_ERR("preprocessor command (-p) is an empty string!\n"); @@ -588,7 +588,8 @@ static FILE *exec_preprocessor(FILE *flat_cfg, const char *preproc_cmdline) filesz += bytes; } while (!feof(flat_cfg)); - result = fcntl(parent_w[1], F_GETPIPE_SZ); +#if __GLIBC_PREREQ(2, 14) + int result = fcntl(parent_w[1], F_GETPIPE_SZ); if (result < 0) { LM_ERR("F_GETPIPE_SZ failed: %d, %s\n", errno, strerror(errno)); goto out_err; @@ -604,6 +605,7 @@ static FILE *exec_preprocessor(FILE *flat_cfg, const char *preproc_cmdline) goto out_err; } } +#endif left = filesz; p = filebuf;