Alexandre Julliard : server: Store the actual process count in snapshots.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Aug 15 13:33:37 CDT 2006


Module: wine
Branch: master
Commit: 498b781e2300681105fcf4a768c7a7d69a632ed1
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=498b781e2300681105fcf4a768c7a7d69a632ed1

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Aug 15 20:31:54 2006 +0200

server: Store the actual process count in snapshots.

We can't rely on running_processes for that, since it now also counts
processes waiting for SIGKILL and those aren't included in snapshots.

---

 server/process.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/server/process.c b/server/process.c
index 733b1c5..b36ca37 100644
--- a/server/process.c
+++ b/server/process.c
@@ -733,6 +733,7 @@ struct process_snapshot *process_snap( i
 {
     struct process_snapshot *snapshot, *ptr;
     struct process *process;
+
     if (!running_processes) return NULL;
     if (!(snapshot = mem_alloc( sizeof(*snapshot) * running_processes )))
         return NULL;
@@ -748,7 +749,12 @@ struct process_snapshot *process_snap( i
         grab_object( process );
         ptr++;
     }
-    *count = running_processes;
+
+    if (!(*count = ptr - snapshot))
+    {
+        free( snapshot );
+        snapshot = NULL;
+    }
     return snapshot;
 }
 




More information about the wine-cvs mailing list