Skip to content

Commit

Permalink
Table CRC Tool Fails To Close File Descriptor, # 1 (#5)
Browse files Browse the repository at this point in the history
Fix #1, Close file descriptor
  • Loading branch information
avan989 authored and skliper committed Sep 10, 2019
1 parent 235d5df commit 772da5c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions cfe_ts_crc.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
#include <stdio.h>
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include "cfe_tbl_filedef.h"
#include "cfe_fs.h"

Expand Down Expand Up @@ -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);
}

0 comments on commit 772da5c

Please sign in to comment.