Преглед на файлове

[Minor] Remove dead loop

tags/3.1
Vsevolod Stakhov преди 2 години
родител
ревизия
0832f067cb
променени са 1 файла, в които са добавени 8 реда и са изтрити 12 реда
  1. 8
    12
      src/libserver/rspamd_symcache.c

+ 8
- 12
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);

Loading…
Отказ
Запис