summaryrefslogtreecommitdiffstats
path: root/raslib
diff options
context:
space:
mode:
authorPeter Baumann <p.baumann@jacobs-university.de>2010-07-27 09:09:46 +0200
committerwww-data <www-data@ubuntu.localdomain>2010-07-30 11:16:37 +0200
commitf75d8d2bd146dd8cfe16207377264218b148d197 (patch)
treecf7141d74b91f5fc7d698bf4d539827d11a82179 /raslib
parentb2119927d072fdd6d99bccceb5fd3fd68771f4d0 (diff)
downloadrasdaman-upstream-f75d8d2bd146dd8cfe16207377264218b148d197.tar.gz
rasdaman-upstream-f75d8d2bd146dd8cfe16207377264218b148d197.tar.xz
rasdaman-upstream-f75d8d2bd146dd8cfe16207377264218b148d197.zip
PB: more benchmark improvement + correct log output handling
Diffstat (limited to 'raslib')
-rw-r--r--raslib/error.cc25
-rw-r--r--raslib/error.hh7
-rw-r--r--raslib/rmdebug.cc2
-rw-r--r--raslib/rminit.cc2
4 files changed, 15 insertions, 21 deletions
diff --git a/raslib/error.cc b/raslib/error.cc
index 6647847..5e5bdbf 100644
--- a/raslib/error.cc
+++ b/raslib/error.cc
@@ -205,20 +205,17 @@ initTextTable()
unsigned int numOfEntries = 0;
int result; // sscanf() result
- // determine file name; use path if env var is set
- strcpy( errorFileName, "" );
- const char* rmanHome = getenv( RASDAMAN_PATH_VARNAME );
- if (rmanHome)
- {
- strcat(errorFileName, rmanHome);
- strcat(errorFileName, ERRORTEXXT_PATH );
- strcat(errorFileName, "/" );
- } else {
- strcat(errorFileName, SHARE_DATA_DIR);
- strcat(errorFileName, "/");
- }
- strcat(errorFileName, ERRORTEXT_FILE );
- // RMInit::logOut << "using error text file: " << errorFileName << endl;
+ // determine file path + name
+ int filenameLength = snprintf( errorFileName, FILENAME_MAX, "%s/%s", SHARE_DATA_DIR, ERRORTEXT_FILE );
+ if (filenameLength < FILENAME_MAX )
+ {
+ RMInit::logOut << "Using error text file: " << errorFileName << endl;
+ }
+ else
+ {
+ errorFileName[FILENAME_MAX-1] = '\0'; // force-terminate string before printing
+ cerr << "Warning: error text file path longer than allowed by OS, likely file will not be found: " << errorFileName << endl;
+ }
// errortexts.open(errorFileName, ios::nocreate | ios::in);
errortexts.open(errorFileName, ios::in);
diff --git a/raslib/error.hh b/raslib/error.hh
index 0042596..35c4e44 100644
--- a/raslib/error.hh
+++ b/raslib/error.hh
@@ -76,11 +76,8 @@ rasdaman GmbH.
* error text file ------------------
*/
-/// name of variable which should contain path to rasdaman home dir
-#define RASDAMAN_PATH_VARNAME "RMANHOME"
-
-/// relative path to error text file, starting from $RMANHOME
-#define ERRORTEXXT_PATH "/bin"
+/// relative path to error text file, starting from rasdaman installation root
+#define ERRORTEXT_PATH "/bin"
/// error text file name
#define ERRORTEXT_FILE "errtxts"
diff --git a/raslib/rmdebug.cc b/raslib/rmdebug.cc
index d047812..c0409c5 100644
--- a/raslib/rmdebug.cc
+++ b/raslib/rmdebug.cc
@@ -46,7 +46,7 @@ using namespace std;
#include "raslib/odmgtypes.hh"
int RManDebug = 0; // debug level (0-4), 0 means no debug info at all
-int RManBenchmark = 0; // benchmark level (0-4)
+int RManBenchmark = 4; // benchmark level (0-4)
// initialization of static variables for RMDebug
int RMDebug::level = 0;
diff --git a/raslib/rminit.cc b/raslib/rminit.cc
index 78c68cf..89802de 100644
--- a/raslib/rminit.cc
+++ b/raslib/rminit.cc
@@ -189,7 +189,7 @@ RMInit::RMInit( char initApplicationType )
else
noTimeOut = 0;
}
- else
+ else // applicationType != 'C' (i.e.: =='S')
{
// default
logOut.rdbuf(cout.rdbuf());