Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion sources/spectator.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,24 @@ int CoCreateSpectator(UBYTE *inp)
while ( *q && ( *q == ',' || *q == ' ' || *q == '\t' ) ) q++;
if ( *q ) goto Syntax;
cc = *p; *p = 0;

/*
Append pid if AM.MultiRun. Allocate space for supplied name + '.' + 5 digits + '\0'
*/
char *filename2 = Malloc1(sizeof(filename) + 1 + 1 + 5, "MultiRun Spectator filename");
if ( AM.MultiRun ) {
sprintf(filename2, "%s.%d", filename, ((int)GetPID())%100000);
}
else {
sprintf(filename2, "%s", filename);
}
/*
Now we need to: create a struct for the spectator file.
*/
if ( HadOne == 0 )
numexpr = EntVar(CEXPRESSION,inp,SPECTATOREXPRESSION,0,0,0);
fh = AllocFileHandle(1,(char *)filename);
fh = AllocFileHandle(1,(char *)filename2);
M_free(filename2, "MultiRun Spectator filename");
/*
Make sure there is space in the AM.spectatorfiles array
*/
Expand Down