]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] Fix fann rewrite
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 28 Apr 2016 17:52:36 +0000 (18:52 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 28 Apr 2016 17:52:36 +0000 (18:52 +0100)
src/plugins/lua/fann_scores.lua

index e72c1d4d662fe1820a5aa613da05de21addcaa6f..2a124f019ddf13193248a1ba00beac4dbac38889 100644 (file)
@@ -186,7 +186,8 @@ local function fann_train_callback(score, required_score,results, cf, id, opts)
     -- Store fann on disk
     local res = false
 
-    if not rspamd_util.stat(fname) then
+    local err,st = rspamd_util.stat(fname)
+    if not err then
       local fd,err = rspamd_util.create_file(fname)
       if not fd then
         rspamd_logger.errx(cf, 'cannot save fann in %s: %s', fname, err)