scheduler: fix FCGI compile warnings

This commit is contained in:
David Anderson 2016-09-11 19:57:08 -07:00
parent c85e0e7f36
commit 67b5f980a7
3 changed files with 41 additions and 22 deletions

View File

@ -252,8 +252,11 @@ int COPROCS::parse(XML_PARSER& xp) {
return ERR_XML_PARSE; return ERR_XML_PARSE;
} }
#ifdef _USING_FCGI_
void COPROCS::write_xml(MIOFILE&, bool) {
}
#else
void COPROCS::write_xml(MIOFILE& mf, bool scheduler_rpc) { void COPROCS::write_xml(MIOFILE& mf, bool scheduler_rpc) {
#ifndef _USING_FCGI_
mf.printf(" <coprocs>\n"); mf.printf(" <coprocs>\n");
for (int i=1; i<n_rsc; i++) { for (int i=1; i<n_rsc; i++) {

View File

@ -799,24 +799,32 @@ void boinc_catch_signal(int signal) {
#endif #endif
#ifdef ANDROID #ifdef ANDROID
// this is some dark undocumented Android voodoo that uses libcorkscrew.so // this is some dark undocumented Android voodoo that uses libcorkscrew.so.
// minimal use of library functions because they may not work in an signal // Minimal use of library functions because they may not work in a signal
// handler. // handler.
//
#define DUMP_LINE_LEN 256 #define DUMP_LINE_LEN 256
static backtrace_frame_t backtrace[64]; static backtrace_frame_t backtrace[64];
static backtrace_symbol_t backtrace_symbols[64]; static backtrace_symbol_t backtrace_symbols[64];
if (unwind_backtrace_signal_arch != NULL) { if (unwind_backtrace_signal_arch != NULL) {
map_info_t *map_info=acquire_my_map_info_list(); map_info_t *map_info = acquire_my_map_info_list();
ssize_t size=unwind_backtrace_signal_arch(siginfo,sigcontext,map_info,backtrace,0,64); ssize_t size = unwind_backtrace_signal_arch(
get_backtrace_symbols(backtrace,size,backtrace_symbols); siginfo, sigcontext, map_info, backtrace, 0, 64
);
get_backtrace_symbols(backtrace, size, backtrace_symbols);
char line[DUMP_LINE_LEN]; char line[DUMP_LINE_LEN];
for (int i=0;i<size;i++) { for (int i=0; i<size; i++) {
format_backtrace_line(i,&backtrace[i],&backtrace_symbols[i],line,DUMP_LINE_LEN); format_backtrace_line(
line[DUMP_LINE_LEN-1]=0; i, &backtrace[i], &backtrace_symbols[i], line, DUMP_LINE_LEN
);
line[DUMP_LINE_LEN-1] = 0;
if (backtrace_symbols[i].symbol_name) { if (backtrace_symbols[i].symbol_name) {
strlcat(line," ",DUMP_LINE_LEN); strlcat(line," ",DUMP_LINE_LEN);
if (backtrace_symbols[i].demangled_name) { if (backtrace_symbols[i].demangled_name) {
strlcat(line,backtrace_symbols[i].demangled_name,DUMP_LINE_LEN); strlcat(
line, backtrace_symbols[i].demangled_name,
DUMP_LINE_LEN
);
} }
} else { } else {
symbol_table_t* symbols = NULL; symbol_table_t* symbols = NULL;
@ -831,24 +839,28 @@ void boinc_catch_signal(int signal) {
} }
if (symbol) { if (symbol) {
int offset = backtrace[i].absolute_pc - symbol->start; int offset = backtrace[i].absolute_pc - symbol->start;
strlcat(line," (",DUMP_LINE_LEN); strlcat(line, " (", DUMP_LINE_LEN);
strlcat(line,symbol->name,DUMP_LINE_LEN); strlcat(line, symbol->name, DUMP_LINE_LEN);
strlcat(line,"+",DUMP_LINE_LEN); strlcat(line, "+", DUMP_LINE_LEN);
strlcat(line,xtoa(offset),DUMP_LINE_LEN); strlcat(line, xtoa(offset), DUMP_LINE_LEN);
strlcat(line,")",DUMP_LINE_LEN); strlcat(line, ")", DUMP_LINE_LEN);
line[DUMP_LINE_LEN-1]=0; line[DUMP_LINE_LEN-1] = 0;
} else { } else {
strlcat(line, " (\?\?\?)",DUMP_LINE_LEN); strlcat(line, " (\?\?\?)", DUMP_LINE_LEN);
} }
if (symbols) free_symbol_table(symbols); if (symbols) free_symbol_table(symbols);
} }
if (backtrace[i].absolute_pc) { if (backtrace[i].absolute_pc) {
strlcat(line," [",DUMP_LINE_LEN); strlcat(line, " [", DUMP_LINE_LEN);
strlcat(line,xtoa(*reinterpret_cast<unsigned int *>(backtrace[i].absolute_pc)),DUMP_LINE_LEN); strlcat(
strlcat(line,"]",DUMP_LINE_LEN); line,
xtoa(*reinterpret_cast<unsigned int *>(backtrace[i].absolute_pc)),
DUMP_LINE_LEN
);
strlcat(line, "]", DUMP_LINE_LEN);
} }
strlcat(line,"\n",DUMP_LINE_LEN); strlcat(line, "\n", DUMP_LINE_LEN);
write(fileno(stderr),line,strlen(line)); write(fileno(stderr),line, strlen(line));
fflush(stderr); fflush(stderr);
} }
} }

View File

@ -319,7 +319,11 @@ void boinc_crash() {
// read file (at most max_len chars, if nonzero) into malloc'd buf // 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) { int read_file_malloc(const char* path, char*& buf, size_t max_len, bool tail) {
#endif
int retval; int retval;
double size; double size;