#endif
string line;
- service_file.exceptions(ios::badbit | ios::failbit);
+ // getline can set failbit if it reaches end-of-file, we don't want an exception in that case. There's
+ // no good way to handle an I/O error however, so we'll have exceptions thrown on badbit:
+ service_file.exceptions(ios::badbit);
// Add a dummy service record now to prevent infinite recursion in case of cyclic dependency.
// We replace this with the real service later (or remove it if we find a configuration error).
add_service(rval);
try {
- // getline can set failbit if it reaches end-of-file, we don't want an exception in that case:
- service_file.exceptions(ios::badbit);
-
process_service_file(name, service_file,
[&](string &line, string &setting, string_iterator &i, string_iterator &end) -> void {
if (setting == "command") {