]> skyeroc.xyz Git - dgamelaunch/commitdiff
Increment/decrement the games[] nwatchers too.
authorPasi Kallinen <paxed@alt.org>
Sun, 2 May 2010 07:28:46 +0000 (07:28 +0000)
committerPasi Kallinen <paxed@alt.org>
Sun, 2 May 2010 07:28:46 +0000 (07:28 +0000)
git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@540 db0b04b0-f4d1-0310-9a6d-de3e77497b0e

dgamelaunch.c

index e81ce1704c4fbd532c0690f96843d7737a9a3236..7d6dfcacc86d7164b98eba71259940569da54348 100644 (file)
@@ -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