From 6a786390fc10775fc9b9d28da2daacdabf36a649 Mon Sep 17 00:00:00 2001 From: rousskov <> Date: Thu, 12 Apr 2007 23:56:39 +0000 Subject: [PATCH] This change should fix bug #1829. The DiskdFile::close function calls the DiskdIOStrategy::send function and consequently the DiskdIOStrategy::SEND function, with shm_offset value of -1. If the msgsnd in SEND fails, the SharedMemory::put function is called with offset=-1, triggering an abort. Patch by Christos Tsantilas. Reviewed by Guido Serassio and Duane Wessels. --- src/DiskIO/DiskDaemon/DiskdIOStrategy.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/DiskIO/DiskDaemon/DiskdIOStrategy.cc b/src/DiskIO/DiskDaemon/DiskdIOStrategy.cc index 60441a636b..6e73855a48 100644 --- a/src/DiskIO/DiskDaemon/DiskdIOStrategy.cc +++ b/src/DiskIO/DiskDaemon/DiskdIOStrategy.cc @@ -1,6 +1,6 @@ /* - * $Id: DiskdIOStrategy.cc,v 1.7 2007/04/07 16:29:06 serassio Exp $ + * $Id: DiskdIOStrategy.cc,v 1.8 2007/04/12 17:56:39 rousskov Exp $ * * DEBUG: section 79 Squid-side DISKD I/O functions. * AUTHOR: Duane Wessels @@ -404,7 +404,8 @@ DiskdIOStrategy::SEND(diomsg *M, int mtype, int id, int size, int offset, off_t debug(79, 1) ("storeDiskdSend: msgsnd: %s\n", xstrerror()); cbdataReferenceDone(M->callback_data); assert(++send_errors < 100); - shm.put (shm_offset); + if (shm_offset > -1) + shm.put(shm_offset); } /* -- 2.47.2