From 67b5f980a7442513a55a8442a0a7a551e8004362 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sun, 11 Sep 2016 19:57:08 -0700 Subject: [PATCH] scheduler: fix FCGI compile warnings --- lib/coproc.cpp | 5 ++++- lib/diagnostics.cpp | 54 +++++++++++++++++++++++++++------------------ lib/util.cpp | 4 ++++ 3 files changed, 41 insertions(+), 22 deletions(-) diff --git a/lib/coproc.cpp b/lib/coproc.cpp index 09a2368958..73ecb70b9d 100644 --- a/lib/coproc.cpp +++ b/lib/coproc.cpp @@ -252,8 +252,11 @@ int COPROCS::parse(XML_PARSER& xp) { return ERR_XML_PARSE; } +#ifdef _USING_FCGI_ +void COPROCS::write_xml(MIOFILE&, bool) { +} +#else void COPROCS::write_xml(MIOFILE& mf, bool scheduler_rpc) { -#ifndef _USING_FCGI_ mf.printf(" \n"); for (int i=1; istart; - strlcat(line," (",DUMP_LINE_LEN); - strlcat(line,symbol->name,DUMP_LINE_LEN); - strlcat(line,"+",DUMP_LINE_LEN); - strlcat(line,xtoa(offset),DUMP_LINE_LEN); - strlcat(line,")",DUMP_LINE_LEN); - line[DUMP_LINE_LEN-1]=0; + strlcat(line, " (", DUMP_LINE_LEN); + strlcat(line, symbol->name, DUMP_LINE_LEN); + strlcat(line, "+", DUMP_LINE_LEN); + strlcat(line, xtoa(offset), DUMP_LINE_LEN); + strlcat(line, ")", DUMP_LINE_LEN); + line[DUMP_LINE_LEN-1] = 0; } else { - strlcat(line, " (\?\?\?)",DUMP_LINE_LEN); + strlcat(line, " (\?\?\?)", DUMP_LINE_LEN); } if (symbols) free_symbol_table(symbols); } if (backtrace[i].absolute_pc) { - strlcat(line," [",DUMP_LINE_LEN); - strlcat(line,xtoa(*reinterpret_cast(backtrace[i].absolute_pc)),DUMP_LINE_LEN); - strlcat(line,"]",DUMP_LINE_LEN); + strlcat(line, " [", DUMP_LINE_LEN); + strlcat( + line, + xtoa(*reinterpret_cast(backtrace[i].absolute_pc)), + DUMP_LINE_LEN + ); + strlcat(line, "]", DUMP_LINE_LEN); } - strlcat(line,"\n",DUMP_LINE_LEN); - write(fileno(stderr),line,strlen(line)); + strlcat(line, "\n", DUMP_LINE_LEN); + write(fileno(stderr),line, strlen(line)); fflush(stderr); } } diff --git a/lib/util.cpp b/lib/util.cpp index 2a7c797541..63f37b95ce 100644 --- a/lib/util.cpp +++ b/lib/util.cpp @@ -319,7 +319,11 @@ void boinc_crash() { // read file (at most max_len chars, if nonzero) into malloc'd buf // +#ifdef _USING_FCGI_ +int read_file_malloc(const char* path, char*& buf, size_t, bool) { +#else int read_file_malloc(const char* path, char*& buf, size_t max_len, bool tail) { +#endif int retval; double size;