Skip to content
Snippets Groups Projects
Commit f8a542d8 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

- gnuplot-fifo now named gnuplot-<PID> which resolves failure of ctest -j<n>

- Exceptions in initialization of CFrida are catched, and line number is reported
parent 324926a3
No related branches found
No related tags found
No related merge requests found
Release 2.3.4d of 28jan17:
- mpgi,mpgr now using NOlo::j2j for spectrum correspondence
- gnuplot-fifo now named gnuplot-<PID> which resolves failure of ctest -j<n>
- Exceptions in initialization of CFrida are catched, and line number is reported
Release 2.3.4c of 27jan17:
- New function NOlo::j2j to prepare for better J:J matching in mpgi, mpgr, and elsewhere
......
......@@ -125,24 +125,48 @@ void CFrida::execute_cmd(const string cmdline)
CFrida::CFrida()
{
// Initializations:
NReadln::initialize(); // command-line dialog (readline and history)
SPloWin::initialize(); // plot windows
gsl_set_error_handler(my_gsl_error_handler);
fbase_initialize();
fassign_initialize();
fstring_initialize();
SGeniRegistry::initialize();
SCvinRegistry::initialize();
if (std::atexit(atexit_handler)) {
cout << "BUG: atexit registration failed\n";
exit(EXIT_FAILURE);
int line = 0;
try {
// Initializations:
NReadln::initialize(); // command-line dialog (readline and history)
line = 1;
SPloWin::initialize(); // plot windows
line = 2;
gsl_set_error_handler(my_gsl_error_handler);
line = 3;
fbase_initialize();
line = 4;
fassign_initialize();
line = 5;
fstring_initialize();
line = 6;
SGeniRegistry::initialize();
line = 7;
SCvinRegistry::initialize();
line = 8;
if (std::atexit(atexit_handler)) {
cout << "BUG: atexit registration failed\n";
exit(EXIT_FAILURE);
}
// time monitor:
line = 9;
clock_start = clock();
clock_cmd_i = clock();
time_cmd = 0;
} catch (string& ex) {
cout << "CFrida initialization failed in line " << line << "\n " << ex << "\n";
exit(1);
} catch (const char* ex) {
cout << "CFrida initialization failed in line " << line << "\n " << ex << "\n";
exit(1);
} catch (std::exception& ex) {
cout << "CFrida initialization failed in line " << line << "\n " << ex.what() << "\n";
exit(1);
} catch (...) {
cout << "CFrida initialization failed in line " << line
<< " with unforeseen exception type\n";
exit(1);
}
// time monitor:
clock_start = clock();
clock_cmd_i = clock();
time_cmd = 0;
}
......@@ -197,6 +221,6 @@ void CFrida::execute_file(const string fnam)
cout << "BUG: char* error in script " << fnam << ", line " << lineno << ":\n " << ex
<< "\n";
} catch (...) {
cout << "BUG: catched invalid exception\n";
cout << "BUG: script " << fnam << " failed with unforeseen exception\n";
}
}
......@@ -13,6 +13,8 @@
#include <fcntl.h>
#include <iostream>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include "../trivia/file_ops.hpp"
#include "../trivia/string_convs.hpp"
......@@ -43,7 +45,7 @@ CPlot::CPlot(int _iPlot, bool _logx, bool _logy)
// == Initialization for Gnuplot ==
// Create a named pipe (FIFO) that will transmit our commands to Gnuplot.
string fn_fifo = string("/tmp/gnuplot-") + getenv("LOGNAME");
string fn_fifo = "/tmp/gnuplot-" + S(getpid());
triv::system("rm -f " + fn_fifo);
if (mkfifo(fn_fifo.c_str(), 0666))
throw "SYSTEM ERROR cannot make fifo " + fn_fifo + ": will not be able to print";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment