// syntax errors, if any, are already printed
if (s.verbose)
{
- clog << "Compilation using a server completed "
+ clog << "Passes: via server " << s.winning_server << " "
<< getmemusage()
<< TIMESPRINT
<< endl;
++servers;
rc = compile_using_server (default_servers[i]);
if (rc == 0)
- return rc; // success!
+ {
+ s.winning_server =
+ default_servers[i].host_name + string(" [") +
+ default_servers[i].ip_address + string(":") +
+ lex_cast(default_servers[i].port) + string("]");
+ return rc; // success!
+ }
+
}
continue;
}
goto error;
}
- f.close ();
+ // NB: not necessary to f.close ();
return 0; // Success
error:
goto error;
}
- f.close ();
+ // NB: not necessary to f.close ();
return 0; // Success
error:
}
// Stream the data
- errno = 0;
- o << f.rdbuf ();
- if (f.fail ())
+
+ // NB: o << f.rdbuf() misbehaves for some reason, appearing to close o,
+ // which is unfortunate if o == cerr or cout.
+ while (1)
{
- cerr << "Error reading file '" << fname << "': ";
- goto error;
+ errno = 0;
+ int c = f.get();
+ if (f.eof ()) return 0; // normal exit
+ if (! f.good()) break;
+ o.put(c);
+ if (! o.good()) break;
}
- f.close ();
- return 0; // Success
+ // NB: not necessary to f.close ();
error:
if (errno)
std::vector<std::string> server_status_strings;
std::vector<std::string> specified_servers;
std::vector<std::string> server_args;
+ std::string winning_server;
+ // XXX: why?
std::string host_name;
std::string domain_name;
-
std::string &get_host_name ();
std::string &get_domain_name ();
void get_host_and_domain_name ();