Added support for stream enabledness checking.

This commit is contained in:
Thulinma 2014-04-18 14:15:32 +02:00
parent 87a2f50dc9
commit af5ad26668

View file

@ -76,11 +76,14 @@ namespace Mist {
if (streamIndex.mapped){ if (streamIndex.mapped){
return; return;
} }
if (!Util::Stream::getStream(streamName)){
DEBUG_MSG(DLVL_FAIL, "Opening stream disallowed - aborting initalization");
return;
}
isInitialized = true; isInitialized = true;
streamIndex.init(streamName,0,false,false); streamIndex.init(streamName,0,false,false);
if (!streamIndex.mapped){ if (!streamIndex.mapped){
sem_t * waiting = sem_open(std::string("/wait_" + streamName).c_str(), O_CREAT | O_RDWR, ACCESSPERMS, 0); sem_t * waiting = sem_open(std::string("/wait_" + streamName).c_str(), O_CREAT | O_RDWR, ACCESSPERMS, 0);
Util::Stream::getStream(streamName);
if (waiting == SEM_FAILED){ if (waiting == SEM_FAILED){
DEBUG_MSG(DLVL_FAIL, "Failed to open semaphore - cancelling"); DEBUG_MSG(DLVL_FAIL, "Failed to open semaphore - cancelling");
onFail(); onFail();