From d464a09c4e3610fccc5f9002ba9c2c5f1f1a5599 Mon Sep 17 00:00:00 2001 From: Ge Wang Date: Sat, 26 Oct 2024 20:29:00 -0700 Subject: [PATCH] align OTF send with updated compiler api --- src/core/chuck_otf.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/core/chuck_otf.cpp b/src/core/chuck_otf.cpp index b62c21438..fd52a3185 100644 --- a/src/core/chuck_otf.cpp +++ b/src/core/chuck_otf.cpp @@ -344,23 +344,22 @@ t_CKINT otf_send_file( const char * fname, OTF_Net_Msg & msg, const char * op, target->fd2parse = fd; target->filename = filename; + // set current target + EM_setCurrentTarget( target ); + // check to see if at least parses if( !chuck_parse( target ) ) { // error message EM_error2( 0, "(parse error) skipping file '%s' for [%s]...", filename.c_str(), op ); - // close file descriptor - fclose( fd ); // reset parser (clean up) | 1.5.1.5 reset_parse(); - // clean up target + // clean up target, including closing the fd CK_SAFE_DELETE( target ); return FALSE; } // reset parser (clean up) | 1.5.1.5 reset_parse(); - // clean up target - CK_SAFE_DELETE( target ); // stat it memset( &fs, 0, sizeof(fs) ); @@ -422,8 +421,8 @@ t_CKINT otf_send_file( const char * fname, OTF_Net_Msg & msg, const char * op, // pop log EM_poplog(); - // close - fclose( fd ); + // clean up target, including closing the fd + CK_SAFE_DELETE( target ); return TRUE; }