Commit 498b781e authored by Alexandre Julliard's avatar Alexandre Julliard

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.
parent 68eddac1
......@@ -733,6 +733,7 @@ struct process_snapshot *process_snap( int *count )
{
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( int *count )
grab_object( process );
ptr++;
}
*count = running_processes;
if (!(*count = ptr - snapshot))
{
free( snapshot );
snapshot = NULL;
}
return snapshot;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment