From: rafan Date: Sat, 10 Apr 2010 06:13:08 +0000 (+0000) Subject: Error out when we can not save the model. This happens if one saves model X-Git-Tag: v160~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c8d2e42aa6b7fd53ac4b38e0a71cc1af6daa8bd3;p=liblinear Error out when we can not save the model. This happens if one saves model under a subdirectory without creating it first. --- diff --git a/train.c b/train.c index a33b501..d6183ba 100644 --- a/train.c +++ b/train.c @@ -104,7 +104,11 @@ int main(int argc, char **argv) else { model_=train(&prob, ¶m); - save_model(model_file_name, model_); + if(save_model(model_file_name, model_)) + { + fprintf(stderr,"can't save model to file %s\n",model_file_name); + exit(1); + } destroy_model(model_); } destroy_param(¶m);