fix exit status: several executables reported success (0) on failure or vice versa
Build and Deploy Documentation / build-and-deploy (push) Successful in 23s
Build and Deploy Documentation / build-and-deploy (push) Successful in 23s
Two bug patterns fixed across src/*.cpp: - musrfit, musrview, any2many, addRun, musrFT, musrt0: a local success/ok/isGood flag was tracked and an error printed, but the function fell through to an unconditional `return PMUSR_SUCCESS;` at the end instead of propagating the failure. - msr2data, msr2msr: the success path returned a nonzero code (1) instead of 0. Also propagate previously-ignored return codes to the process exit status in dump_header (format-dispatch functions), musrRootValidation (schema validation / consistency checks), and write_musrRoot_runHeader (FillFolder failure).
This commit is contained in:
@@ -245,8 +245,11 @@ int main(int argc, char *argv[])
|
||||
// root file header related things
|
||||
TFolder *runHeader = new TFolder("RunHeader", "MusrRoot Run Header Info");
|
||||
|
||||
if (header->FillFolder(runHeader)) {
|
||||
bool success = header->FillFolder(runHeader);
|
||||
if (success) {
|
||||
runHeader->Write();
|
||||
} else {
|
||||
std::cerr << std::endl << "**ERROR** couldn't fill the MusrRoot run header folder." << std::endl;
|
||||
}
|
||||
|
||||
f->Close();
|
||||
@@ -255,5 +258,8 @@ int main(int argc, char *argv[])
|
||||
delete f;
|
||||
delete header;
|
||||
|
||||
if (!success)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user