From 8ebfbae13b82c13c54434b7495b9c80a25cd4f65 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 8 Sep 2016 16:20:30 +0100 Subject: [PATCH] [Minor] Improve shared memory fd check --- src/libutil/http.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libutil/http.c b/src/libutil/http.c index ba62b422d4..e8f049ddc9 100644 --- a/src/libutil/http.c +++ b/src/libutil/http.c @@ -2546,7 +2546,7 @@ rspamd_http_message_storage_cleanup (struct rspamd_http_message *msg) if (msg->flags & RSPAMD_HTTP_FLAG_SHMEM) { storage = &msg->body_buf.c; - if (storage->shared.shm_fd != -1) { + if (storage->shared.shm_fd > 0) { g_assert (fstat (storage->shared.shm_fd, &st) != -1); if (msg->body_buf.str != MAP_FAILED) { -- 2.47.3