Commit 9109630d authored by Christopher Alfeld's avatar Christopher Alfeld
Browse files

Added check on file input.

Updated help output.
parent 5daed6f4
...@@ -455,7 +455,7 @@ void del_node_handler(GraphWin& gw) { display_scc(gw); } ...@@ -455,7 +455,7 @@ void del_node_handler(GraphWin& gw) { display_scc(gw); }
void usage() { void usage() {
fprintf(stderr, fprintf(stderr,
"usage: ann [-h] [-ao] [-s <switches>] [-n nodes/switch] [-c cap]\n" "usage: assign [-h] [-ao] [-s <switches>] [-n nodes/switch] [-c cap] [file]\n"
" -h ...... brief help listing\n" " -h ...... brief help listing\n"
" -s # ... number of switches in cluster\n" " -s # ... number of switches in cluster\n"
" -n # ... number of nodes per switch\n" " -n # ... number of nodes per switch\n"
...@@ -513,7 +513,10 @@ int main(int argc, char **argv) ...@@ -513,7 +513,10 @@ int main(int argc, char **argv)
if (argc == 1) { if (argc == 1) {
ifstream infile; ifstream infile;
infile.open(argv[0]); infile.open(argv[0]);
/* XXX: Check my return value, please */ if (!infile) {
cerr << "Error opening file: " << argv[0] << "\n";
exit(1);
}
parse_top(G, infile); parse_top(G, infile);
gw.update_graph(); gw.update_graph();
node n; node n;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment