Skip to content

Commit

Permalink
Merge pull request #48 from c-dilks/fix-zero-exit
Browse files Browse the repository at this point in the history
fix: return nonzero exit code for failures
  • Loading branch information
gavalian authored Feb 13, 2024
2 parents 87c3337 + caceff1 commit f40da67
Show file tree
Hide file tree
Showing 24 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion examples/benchmarks/ana_benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ int main(int argc, char** argv) {
//sprintf(outputFile,"%s",argv[2]);
} else {
std::cout << " *** please provide a file name..." << std::endl;
exit(0);
exit(1);
}

hipo::reader reader;
Expand Down
2 changes: 1 addition & 1 deletion examples/builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ int main(int argc, char** argv) {
//sprintf(outputFile,"%s",argv[2]);
} else {
std::cout << " *** please provide a file name..." << std::endl;
exit(0);
exit(1);
}

hipo::reader reader;
Expand Down
2 changes: 1 addition & 1 deletion examples/histograms.cc
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ int main(int argc, char** argv) {
//sprintf(outputFile,"%s",argv[2]);
} else {
std::cout << " *** please provide a file name..." << std::endl;
exit(0);
exit(1);
}

//example3(inputFile);
Expand Down
2 changes: 1 addition & 1 deletion examples/readEvents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ int main(int argc, char** argv) {
//sprintf(outputFile,"%s",argv[2]);
} else {
std::cout << " *** please provide a file name..." << std::endl;
exit(0);
exit(1);
}

hipo::reader reader;
Expand Down
2 changes: 1 addition & 1 deletion examples/readFile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ int main(int argc, char** argv) {
//sprintf(outputFile,"%s",argv[2]);
} else {
std::cout << " *** please provide a file name..." << std::endl;
exit(0);
exit(1);
}

hipo::reader reader;
Expand Down
2 changes: 1 addition & 1 deletion examples/readFileDebug.cc
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ int main(int argc, char** argv) {
//sprintf(outputFile,"%s",argv[2]);
} else {
std::cout << " *** please provide a file name..." << std::endl;
exit(0);
exit(1);
}


Expand Down
2 changes: 1 addition & 1 deletion examples/readFileTags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ int main(int argc, char** argv) {
//sprintf(outputFile,"%s",argv[2]);
} else {
std::cout << " *** please provide a file name..." << std::endl;
exit(0);
exit(1);
}
hipo::reader reader;
Expand Down
2 changes: 1 addition & 1 deletion examples/readFusion.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ int main(int argc, char** argv) {
//sprintf(outputFile,"%s",argv[2]);
} else {
std::cout << " *** please provide a file name..." << std::endl;
exit(0);
exit(1);
}

hipo::fusion fusion;
Expand Down
2 changes: 1 addition & 1 deletion examples/readHist.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ int main(int argc, char** argv) {
//sprintf(outputFile,"%s",argv[2]);
} else {
std::cout << " *** please provide a file name..." << std::endl;
exit(0);
exit(1);
}

hipo::reader reader;
Expand Down
2 changes: 1 addition & 1 deletion examples/readJson.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ int main(int argc, char** argv) {
//sprintf(outputFile,"%s",argv[2]);
} else {
std::cout << " *** please provide a file name..." << std::endl;
exit(0);
exit(1);
}

hipo::reader reader;
Expand Down
2 changes: 1 addition & 1 deletion examples/root/benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ int main(int argc, char** argv) {
//sprintf(outputFile,"%s",argv[2]);
} else {
std::cout << " *** please provide a file name..." << std::endl;
exit(0);
exit(1);
}


Expand Down
2 changes: 1 addition & 1 deletion examples/root/converter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ int main(int argc, char** argv) {
//sprintf(outputFile,"%s",argv[2]);
} else {
std::cout << " *** please provide a file name..." << std::endl;
exit(0);
exit(1);
}

convert(inputFile);
Expand Down
2 changes: 1 addition & 1 deletion examples/root/hist2root.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ int main(int argc, char** argv) {
sprintf(outputFile,"%s.root",argv[1]);
} else {
std::cout << " *** please provide a file name..." << std::endl;
exit(0);
exit(1);
}


Expand Down
2 changes: 1 addition & 1 deletion examples/showFile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ int main(int argc, char** argv) {
//sprintf(outputFile,"%s",argv[2]);
} else {
std::cout << " *** please provide a file name..." << std::endl;
exit(0);
exit(1);
}

hipo::reader reader;
Expand Down
2 changes: 1 addition & 1 deletion examples/writeEvents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ int main(int argc, char** argv) {
//sprintf(outputFile,"%s",argv[2]);
} else {
std::cout << " *** please provide a file name..." << std::endl;
exit(0);
exit(1);
}

char outputFile[256];
Expand Down
2 changes: 1 addition & 1 deletion extensions/coda/translate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ int main(int argc, char** argv){
//sprintf(outputFile,"%s",argv[2]);
} else {
std::cout << " *** please provide a file name..." << std::endl;
exit(0);
exit(1);
}

//bank.show();
Expand Down
2 changes: 1 addition & 1 deletion extensions/dc/cmdparser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ namespace cli {
args.output << this->usage();
//#pragma warning(push)
//#pragma warning(disable: 4702)
exit(0);
exit(1);
return false;
//#pragma warning(pop)
}), "", true);
Expand Down
2 changes: 1 addition & 1 deletion extensions/dc/denoise.cc
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ std::cout << std::endl;

/*char inputFile[256];
if(argc>1) { sprintf(inputFile,"%s",argv[1]);} else {
std::cout << " *** please provide a file name..." << std::endl;exit(0);
std::cout << " *** please provide a file name..." << std::endl;exit(1);
}*/

chamber.setRows(112);
Expand Down
2 changes: 1 addition & 1 deletion extensions/dc/denoise2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ std::cout << std::endl;

/*char inputFile[256];
if(argc>1) { sprintf(inputFile,"%s",argv[1]);} else {
std::cout << " *** please provide a file name..." << std::endl;exit(0);
std::cout << " *** please provide a file name..." << std::endl;exit(1);
}*/

chamber.setRows(112);
Expand Down
2 changes: 1 addition & 1 deletion extensions/machine/analyze.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ int main(int argc, char** argv){
//sprintf(outputFile,"%s",argv[2]);
} else {
std::cout << " *** please provide a file name..." << std::endl;
exit(0);
exit(1);
}

hipo::reader reader;
Expand Down
2 changes: 1 addition & 1 deletion extensions/machine/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ int main(int argc, char** argv){
//sprintf(outputFile,"%s",argv[2]);
} else {
std::cout << " *** please provide a file name..." << std::endl;
exit(0);
exit(1);
}

hipo::reader reader;
Expand Down
2 changes: 1 addition & 1 deletion hipo4/dictionary.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class schema {
schema &getSchema(const char *name){
if(factory.count(name)==0){
printf("\n\nhipo::dictionary (ERROR) schema {%s} does not exist... exiting\n\n",name);
exit(0);
exit(1);
}
return factory[name];
}
Expand Down
4 changes: 2 additions & 2 deletions hipo4/reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ std::vector<hipo::bank> reader::getBanks(std::vector<std::string> names){

if(inputStream.is_open()==false){
printf("\n\nhipo::reader (ERROR) file is not open.... exiting...\n\n");
exit(0);
exit(1);
}
long position = header.headerLength*4;
hipo::record dictRecord;
Expand Down Expand Up @@ -322,7 +322,7 @@ std::vector<hipo::bank> reader::getBanks(std::vector<std::string> names){
void reader::readDictionary(hipo::dictionary &dict){
if(inputStream.is_open()==false){
printf("\n\nhipo::reader (ERROR) file is not open.... exiting...\n\n");
exit(0);
exit(1);
}
long position = header.headerLength*4;
hipo::record dictRecord;
Expand Down
2 changes: 1 addition & 1 deletion hipo4/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ namespace hipo {
file_header.append(" char inputFile[256];\n\n" );
file_header.append(" if(argc>1) {\n sprintf(inputFile,\"%s\",argv[1]);\n } else {\n " );
file_header.append(" std::cout << \" *** please provide a file name...\" << std::endl;\n" );
file_header.append(" exit(0);\n }\n\n");
file_header.append(" exit(1);\n }\n\n");
file_header.append(" hipo::reader reader;\n");
file_header.append(" reader.open(inputFile);\n\n" );
return file_header;
Expand Down

0 comments on commit f40da67

Please sign in to comment.