From d19af7519f57589373569cc592ae49b7cba55e15 Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Thu, 26 Apr 2012 09:31:34 +0200 Subject: merge older changes, more polishing --- dtrain/dtrain.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'dtrain/dtrain.h') diff --git a/dtrain/dtrain.h b/dtrain/dtrain.h index 783aa179..61d60657 100644 --- a/dtrain/dtrain.h +++ b/dtrain/dtrain.h @@ -1,5 +1,5 @@ -#ifndef _DTRAIN_COMMON_H_ -#define _DTRAIN_COMMON_H_ +#ifndef _DTRAIN_H_ +#define _DTRAIN_H_ #include #include @@ -13,9 +13,9 @@ #include "filelib.h" -#define DTRAIN_LOCAL +//#define DTRAIN_LOCAL -#define DTRAIN_DOTS 10 // when to display a '.' +#define DTRAIN_DOTS 10 // after how many inputs to display a '.' #define DTRAIN_GRAMMAR_DELIM "########EOS########" #define DTRAIN_SCALE 100000 @@ -35,7 +35,10 @@ inline string gettmpf(const string path, const string infix) { strcat(fn, "/"); strcat(fn, infix.c_str()); strcat(fn, "-XXXXXX"); - mkstemp(fn); + if (!mkstemp(fn)) { + cerr << "Cannot make temp file in" << path << " , exiting." << endl; + exit(1); + } return string(fn); } -- cgit v1.2.3