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.
/*
- * $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
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);
}
/*