Skip to content

Commit

Permalink
streamCTRL can autorelink overwritten SHMs
Browse files Browse the repository at this point in the history
  • Loading branch information
DasVinch committed Jan 17, 2024
1 parent 64b229c commit e6552e5
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/CommandLineInterface/streamCTRL/streamCTRL_scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,15 @@ void *streamCTRL_scan(
streaminfo[sindex].sname,
ID);*/

// Check if the inode exists but has been externally overwritten
if(ID != -1
&& ImageStreamIO_check_image_inode(&images[ID]) == IMAGESTREAMIO_INODE)
{
ImageStreamIO_closeIm(&images[ID]);
ID = -1;
}

// if not in local memory, try to connect to stream
//
if(ID == -1)
{
// if not in memory, try to load
Expand All @@ -168,7 +175,7 @@ void *streamCTRL_scan(
images[ID].used = 1;
// keep track of name
strncpy(images[ID].name, streaminfo[sindex].sname, STRINGMAXLEN_IMAGE_NAME - 1);
images[ID].name[STRINGMAXLEN_IMAGE_NAME-1] = '\0';
images[ID].name[STRINGMAXLEN_IMAGE_NAME - 1] = '\0';

streaminfo[sindex].deltacnt0 = 1;
streaminfo[sindex].updatevalue = 1.0;
Expand All @@ -178,7 +185,7 @@ void *streamCTRL_scan(
{
// if in memory, check if image data has been loaded
//
if ( images[ID].array.raw == NULL )
if(images[ID].array.raw == NULL)
{
streaminfo[sindex].ISIOretval = IMAGESTREAMIO_FILEOPEN;
}
Expand All @@ -187,7 +194,7 @@ void *streamCTRL_scan(
streaminfo[sindex].ISIOretval = IMAGESTREAMIO_SUCCESS;
}

if(streaminfo[sindex].ISIOretval == IMAGESTREAMIO_SUCCESS )
if(streaminfo[sindex].ISIOretval == IMAGESTREAMIO_SUCCESS)
{
/*EXECUTE_SYSTEM_COMMAND("echo \" %ld ISIO OK\" >> IDlog.txt",
sindex);*/
Expand Down

0 comments on commit e6552e5

Please sign in to comment.