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.
This commit is contained in:
Alexandre Julliard 2006-08-15 20:31:54 +02:00
parent 68eddac14b
commit 498b781e23
1 changed files with 7 additions and 1 deletions

View File

@ -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;
}