Skip to content
Snippets Groups Projects
Commit 9c8e056c authored by Jan Trávníček's avatar Jan Trávníček
Browse files

fix warn unused result in measuremets

parent db3a0b98
No related branches found
No related tags found
No related merge requests found
...@@ -233,15 +233,18 @@ void MeasurementProvisioner::PipelineRunnerEnvironment::commandFdSwap ( ) { ...@@ -233,15 +233,18 @@ void MeasurementProvisioner::PipelineRunnerEnvironment::commandFdSwap ( ) {
// swap stdin and stdout for next command // swap stdin and stdout for next command
close ( 0 ); close ( 0 );
close ( 1 ); close ( 1 );
dup ( outputTmpfile.fd ); if ( dup ( outputTmpfile.fd ) == -1 || dup ( inputTmpfile.fd ) == -1) {
dup ( inputTmpfile.fd ); throw::exception::CommonException ( "MeasurementProvisioner: dup failed" );
}
   
// rewind previous stdout to the beginning, so the next command can read the whole file as input // rewind previous stdout to the beginning, so the next command can read the whole file as input
lseek ( 0, 0, SEEK_SET ); lseek ( 0, 0, SEEK_SET );
   
// destroy the contents of previous stdin and rewind to the beginning // destroy the contents of previous stdin and rewind to the beginning
lseek ( 1, 0, SEEK_SET ); lseek ( 1, 0, SEEK_SET );
ftruncate ( 1, 0 ); if(ftruncate ( 1, 0 ) == -1) {
throw::exception::CommonException ( "MeasurementProvisioner: ftruncate failed" );
}
} }
   
void MeasurementProvisioner::PipelineRunnerEnvironment::commandFdEnd ( ) { void MeasurementProvisioner::PipelineRunnerEnvironment::commandFdEnd ( ) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment