diff --git a/sched/sched_send.C b/sched/sched_send.C index 9146f9bce6..eb6a346ef6 100644 --- a/sched/sched_send.C +++ b/sched/sched_send.C @@ -46,6 +46,8 @@ using namespace std; #ifdef _USING_FCGI_ #include "fcgi_stdio.h" +#else +#define FCGI_ToFILE(x) (x) #endif const int MIN_SECONDS_TO_SEND = 0; @@ -339,7 +341,6 @@ URLTYPE* read_download_list() { if (cached) return cached; -#ifndef _USING_FCGI_ if (!(fp=fopen("../download_servers", "r"))) { log_messages.printf( SCHED_MSG_LOG::CRITICAL, @@ -357,7 +358,7 @@ URLTYPE* read_download_list() { } // read timezone offset and URL from file, and store in cache // list - if (2==fscanf(fp, "%d %s", &(cached[count].zone), cached[count].name)) { + if (2==fscanf(FCGI_ToFILE(fp), "%d %s", &(cached[count].zone), cached[count].name)) { count++; } else { // provide a null terminator so we don't need to keep @@ -393,7 +394,6 @@ URLTYPE* read_download_list() { SCHED_MSG_LOG::DEBUG, "zone=%+d url=%s\n", cached[i].zone, cached[i].name ); } -#endif return cached; } diff --git a/tools/backend_lib.C b/tools/backend_lib.C index 9cd66f7107..de69eb28c5 100644 --- a/tools/backend_lib.C +++ b/tools/backend_lib.C @@ -39,6 +39,8 @@ #ifdef _USING_FCGI_ #include "fcgi_stdio.h" +#else +#define FCGI_ToFILE(x) (x) #endif static struct random_init { @@ -70,7 +72,6 @@ static bool got_md5_info( double *nbytes ) { bool retval=false; -#ifndef _USING_FCGI_ // look for file named FILENAME.md5 containing md5sum and length. // If found, and newer mod time than file, read md5 sum and file // length from it. @@ -97,9 +98,9 @@ static bool got_md5_info( // read two quantities: md5 sum and length. If we can't read // these, or there is MORE stuff in the file' it's not an md5 // cache file - if (3 == fscanf(fp, "%s %lf%c", md5data, nbytes, &endline) && + if (3 == fscanf(FCGI_ToFILE(fp), "%s %lf%c", md5data, nbytes, &endline) && endline=='\n' && - EOF==fgetc(fp) + EOF==fgetc(FCGI_ToFILE(fp)) ) retval=true; fclose(fp); @@ -110,7 +111,6 @@ static bool got_md5_info( unlink(md5name); retval=false; } -#endif return retval; }