Fix for Cygwin input crashes

This commit is contained in:
Thulinma 2017-08-02 14:42:05 +02:00
parent 41ec2822b1
commit 6c4cea3954

View file

@ -124,6 +124,11 @@ namespace Mist {
while (config->is_active){ while (config->is_active){
pid_t pid = fork(); pid_t pid = fork();
if (pid == 0){ if (pid == 0){
//Re-init streamStatus to fix Cygwin issues
char pageName[NAME_BUFFER_SIZE];
snprintf(pageName, NAME_BUFFER_SIZE, SHM_STREAM_STATE, streamName.c_str());
streamStatus.init(pageName, 1, false, false);
if (streamStatus){streamStatus.mapped[0] = STRMSTAT_INIT;}
if (needsLock()){playerLock.close();} if (needsLock()){playerLock.close();}
if (!preRun()){return 0;} if (!preRun()){return 0;}
return run(); return run();