diff --git a/cfe_ts_crc.c b/cfe_ts_crc.c index 4fb5b87..1ef3561 100644 --- a/cfe_ts_crc.c +++ b/cfe_ts_crc.c @@ -42,6 +42,8 @@ #include #include #include +#include +#include #include "cfe_tbl_filedef.h" #include "cfe_fs.h" @@ -175,7 +177,14 @@ int main( int argc, char **argv ) if (readSize != 100) done=1; } /* print the size/CRC results */ - printf("\nTable File Name: %s\nTable Size: %d Bytes\nExpected TS Validation CRC: 0x%08X\n\n", argv[1], fileSize, fileCRC); + printf("\nTable File Name: %s\nTable Size: %d Bytes\nExpected TS Validation CRC: 0x%08X\n\n", argv[1], fileSize, fileCRC); - return(fileCRC); + /* Close file and check*/ + if( close(fd) != 0 ) + { + printf("\nerror: Cannot close file!\n"); + exit(0); + } + + return(fileCRC); }