From: Pasi Kallinen Date: Sun, 2 May 2010 07:28:46 +0000 (+0000) Subject: Increment/decrement the games[] nwatchers too. X-Git-Tag: v1.6.1-roc-dev~169 X-Git-Url: https://skyeroc.xyz/gitweb/?a=commitdiff_plain;h=afa0b07631b097ee999db3be2295c26cd43a5b6e;p=dgamelaunch Increment/decrement the games[] nwatchers too. git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@540 db0b04b0-f4d1-0310-9a6d-de3e77497b0e --- diff --git a/dgamelaunch.c b/dgamelaunch.c index e81ce17..7d6dfca 100644 --- a/dgamelaunch.c +++ b/dgamelaunch.c @@ -835,8 +835,10 @@ watchgame: shm_idx = games[idx]->shm_idx; shm_sem_wait(shm_dg_data); if (shm_dg_game[shm_idx].in_use && - !strcmp(shm_dg_game[shm_idx].ttyrec_fn, games[idx]->ttyrec_fn)) + !strcmp(shm_dg_game[shm_idx].ttyrec_fn, games[idx]->ttyrec_fn)) { shm_dg_game[shm_idx].nwatchers++; + games[idx]->nwatchers++; + } shm_sem_post(shm_dg_data); } #endif @@ -856,8 +858,10 @@ watchgame: shm_sem_wait(shm_dg_data); if (shm_dg_game[shm_idx].in_use && !strcmp(shm_dg_game[shm_idx].ttyrec_fn, games[idx]->ttyrec_fn) && - (shm_dg_game[shm_idx].nwatchers > 0)) + (shm_dg_game[shm_idx].nwatchers > 0)) { shm_dg_game[shm_idx].nwatchers--; + games[idx]->nwatchers--; + } shm_sem_post(shm_dg_data); } #endif