git-svn-id: http://svn.openzap.org/svn/openzap/trunk@426 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
Anthony Minessale
2008-03-19 20:45:57 +00:00
parent 6ac134b105
commit 6880c95573
4 changed files with 81 additions and 39 deletions

View File

@@ -979,16 +979,17 @@ zap_status_t zap_channel_close(zap_channel_t **zchan)
return ZAP_FAIL;
}
zap_mutex_lock(check->mutex);
if (zap_test_flag(check, ZAP_CHANNEL_OPEN)) {
status = check->zio->close(check);
if (status == ZAP_SUCCESS) {
zap_channel_reset(check);
*zchan = NULL;
if (zap_test_flag(check, ZAP_CHANNEL_CONFIGURED)) {
zap_mutex_lock(check->mutex);
if (zap_test_flag(check, ZAP_CHANNEL_OPEN)) {
status = check->zio->close(check);
if (status == ZAP_SUCCESS) {
zap_channel_reset(check);
*zchan = NULL;
}
}
zap_mutex_unlock(check->mutex);
}
zap_mutex_unlock(check->mutex);
return status;
}