diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-09-17 21:36:32 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-09-17 21:36:32 +0100 |
commit | 0832f067cbba7812e166f857326c8f83d220692a (patch) | |
tree | 6eb4a6ffaa51699b137c4d066918e7a4505878f0 | |
parent | e00abd7047b660372eebd9f30aa28ed8366493d6 (diff) | |
download | rspamd-0832f067cbba7812e166f857326c8f83d220692a.tar.gz rspamd-0832f067cbba7812e166f857326c8f83d220692a.zip |
[Minor] Remove dead loop
-rw-r--r-- | src/libserver/rspamd_symcache.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/libserver/rspamd_symcache.c b/src/libserver/rspamd_symcache.c index bd8a5bb91..41aa784b6 100644 --- a/src/libserver/rspamd_symcache.c +++ b/src/libserver/rspamd_symcache.c @@ -952,21 +952,17 @@ rspamd_symcache_save_items (struct rspamd_symcache *cache, const gchar *name) rspamd_snprintf (path, sizeof (path), "%s.new", name); - for (;;) { - fd = open (path, O_CREAT | O_WRONLY | O_EXCL, 00644); + fd = open (path, O_CREAT | O_WRONLY | O_EXCL, 00644); - if (fd == -1) { - if (errno == EEXIST) { - /* Some other process is already writing data, give up silently */ - return TRUE; - } - - msg_err_cache ("cannot open file %s, error %d, %s", path, - errno, strerror (errno)); - return FALSE; + if (fd == -1) { + if (errno == EEXIST) { + /* Some other process is already writing data, give up silently */ + return TRUE; } - break; + msg_err_cache ("cannot open file %s, error %d, %s", path, + errno, strerror (errno)); + return FALSE; } rspamd_file_lock (fd, FALSE); |