readvectors.h 546 B

1234567891011121314151617181920212223242526272829
  1. int read_final_correction_word(bool party, DB_t& FCW_read)
  2. {
  3. if(!party)
  4. {
  5. int const in0 { open( "FCW0", O_RDONLY ) };
  6. size_t r = read(in0, &FCW_read, sizeof(FCW_read));
  7. if(r < 0) {
  8. perror("Read error");
  9. close(in0);
  10. return 1;
  11. }
  12. }
  13. if(party)
  14. {
  15. int const in0 { open( "FCW1", O_RDONLY ) };
  16. size_t r = read(in0, &FCW_read, sizeof(FCW_read));
  17. if(r < 0) {
  18. perror("Read error");
  19. close(in0);
  20. return 1;
  21. }
  22. }
  23. return 0;
  24. }