]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix some errno handling
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 15 Mar 2016 11:53:00 +0000 (11:53 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 15 Mar 2016 11:53:00 +0000 (11:53 +0000)
src/fuzzy_storage.c

index c275f661346f44abe0e6da37983097ff19991171..151a0ba6489da5f402ff833c0750e6515a3ac159 100644 (file)
@@ -1323,7 +1323,13 @@ rspamd_fuzzy_peer_io (gint fd, gshort what, gpointer d)
        r = read (fd, &cmd, sizeof (cmd));
 
        if (r != sizeof (cmd)) {
-               msg_err ("cannot read command from peers: %s", strerror (errno));
+               if (errno == EINTR) {
+                       rspamd_fuzzy_peer_io (fd, what, d);
+                       return;
+               }
+               if (errno != EAGAIN) {
+                       msg_err ("cannot read command from peers: %s", strerror (errno));
+               }
        }
        else {
                pcmd = g_slice_alloc (sizeof (*pcmd));