From: Vsevolod Stakhov Date: Thu, 8 Sep 2016 15:20:30 +0000 (+0100) Subject: [Minor] Improve shared memory fd check X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ebfbae13b82c13c54434b7495b9c80a25cd4f65;p=thirdparty%2Frspamd.git [Minor] Improve shared memory fd check --- 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) {