]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Improve shared memory fd check
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 8 Sep 2016 15:20:30 +0000 (16:20 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 18 Nov 2016 14:47:33 +0000 (14:47 +0000)
src/libutil/http.c

index ba62b422d47225ae2fab7712a8071c0fa5e49977..e8f049ddc952a00d893371d7969633aaf09e176a 100644 (file)
@@ -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) {