I've checked out latest git branch. If I run findscu and it can't connect to the PACS, the process exits with status 0. I'd like it to exit with 1 indicating there was an error. I would like to submit a simple patch (I hope the diff format is correct, I'm not that good with git):
Code: Select all
diff --git dcmnet/apps/findscu.cc dcmnet/apps/findscu.cc
index a17220f..60fca13 100644
--- dcmnet/apps/findscu.cc
+++ dcmnet/apps/findscu.cc
@@ -627,10 +627,15 @@ int main(int argc, char *argv[])
NULL, /* we want to use the default callback */
&fileNameList,
opt_outputDirectory.c_str());
-
+ if (cond.bad()) return 1;
+
// destroy network structure
cond = findscu.dropNetwork();
- if (cond.bad()) OFLOG_ERROR(findscuLogger, DimseCondition::dump(temp_str, cond));
+ if (cond.bad())
+ {
+ OFLOG_ERROR(findscuLogger, DimseCondition::dump(temp_str, cond));
+ return 1;
+ }
#ifdef HAVE_WINSOCK_H
WSACleanup();
@@ -644,9 +649,11 @@ int main(int argc, char *argv[])
if (!tLayer->writeRandomSeed(opt_writeSeedFile))
{
OFLOG_ERROR(findscuLogger, "cannot write random seed file '" << opt_writeSeedFile << "', ignoring");
+ return 1;
}
} else {
OFLOG_ERROR(findscuLogger, "cannot write random seed, ignoring");
+ return 1;
}
}
delete tLayer;
Thank you.