From b80a6871c46587e14f95891a0b311885f3933e42 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 15 Mar 2016 11:53:00 +0000 Subject: [PATCH] [Minor] Fix some errno handling --- src/fuzzy_storage.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/fuzzy_storage.c b/src/fuzzy_storage.c index c275f6613..151a0ba64 100644 --- a/src/fuzzy_storage.c +++ b/src/fuzzy_storage.c @@ -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)); -- 2.39.5