From 29dab31b110059ccc34e739ccdce66603a2c92b9 Mon Sep 17 00:00:00 2001
From: Gavin Hurlbut <ghurlbut@mythtv.org>
Date: Wed, 5 Jan 2011 19:19:03 -0800
Subject: [PATCH] Fix race condition on m_pMap read on close
We really should check that it DID find an fd in the map.
---
mythtv/libs/libmythdb/system-unix.cpp | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/mythtv/libs/libmythdb/system-unix.cpp b/mythtv/libs/libmythdb/system-unix.cpp
index 960ed3c..0f29c6e 100644
a
|
b
|
void MythSystemIOHandler::remove(int fd) |
203 | 203 | { |
204 | 204 | PMap_t::iterator i; |
205 | 205 | i = m_pMap.find(fd); |
206 | | HandleRead(i.key(), i.value()); |
| 206 | if ( i != m_pMap.end() ) |
| 207 | HandleRead(i.key(), i.value()); |
207 | 208 | } |
208 | 209 | m_pMap.remove(fd); |
209 | 210 | BuildFDs(); |