From 0dc2a6155a8da86aec24b9af1aef420fe1dfa8bf Mon Sep 17 00:00:00 2001 From: Erik Zandvliet Date: Wed, 16 Jul 2014 12:53:40 +0200 Subject: [PATCH] Removed an unused semaphore --- src/input/input.cpp | 8 -------- src/input/mist_in.cpp | 12 ------------ 2 files changed, 20 deletions(-) diff --git a/src/input/input.cpp b/src/input/input.cpp index bf5fcb25..680416a9 100644 --- a/src/input/input.cpp +++ b/src/input/input.cpp @@ -163,14 +163,6 @@ namespace Mist { } } - IPC::semaphore waiting(std::string("/wait_" + config->getString("streamname")).c_str(), O_CREAT | O_RDWR, ACCESSPERMS, 0); - if (!waiting){ - DEBUG_MSG(DLVL_FAIL, "Failed to open semaphore - cancelling"); - return -1; - } - waiting.post(); - waiting.close(); - DEBUG_MSG(DLVL_HIGH,"Pre-While"); long long int activityCounter = Util::getMS(); diff --git a/src/input/mist_in.cpp b/src/input/mist_in.cpp index eae8df8d..79f0d7b5 100644 --- a/src/input/mist_in.cpp +++ b/src/input/mist_in.cpp @@ -34,18 +34,6 @@ int main(int argc, char * argv[]) { //wait for the process to exit int status; while (waitpid(pid, &status, 0) != pid && errno == EINTR) continue; - //clean up the semaphore by waiting for it, if it's non-zero - IPC::semaphore waiting(std::string("/wait_" + conf.getString("streamname")).c_str(), O_CREAT | O_RDWR, ACCESSPERMS, 0); - if (!waiting){ - DEBUG_MSG(DLVL_FAIL, "Failed to open semaphore - cancelling"); - return -1; - } - int sem_val = waiting.getVal(); - while (sem_val){ - waiting.wait(); - sem_val = waiting.getVal(); - } - waiting.close(); //if the exit was clean, don't restart it if (WIFEXITED(status) && (WEXITSTATUS(status) == 0)){ DEBUG_MSG(DLVL_MEDIUM, "Finished player succesfully");