]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Remove dead loop
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 17 Sep 2021 20:36:32 +0000 (21:36 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 17 Sep 2021 20:36:32 +0000 (21:36 +0100)
src/libserver/rspamd_symcache.c

index bd8a5bb9107703cfa8ac2504163987a3ab1ce946..41aa784b6ab1bf51a15f25d2b08a14543bd2f5bc 100644 (file)
@@ -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);