simplified the semaphore stuff to return correct errors during opening.. more work to do here!