patch-par1repairer_cpp 905 B

1234567891011121314151617181920212223242526
  1. $OpenBSD: patch-par1repairer_cpp,v 1.3 2016/06/13 17:32:27 semarie Exp $
  2. pledge:
  3. 'par2 repair' with par1 files - stdio rpath cpath
  4. once the target files have been opened for writing, wpath is no
  5. longer required, cpath must be kept to delete partial files in
  6. case of an error
  7. --- par1repairer.cpp.orig Wed Jun 8 23:41:11 2016
  8. +++ par1repairer.cpp Wed Jun 8 23:42:01 2016
  9. @@ -157,6 +157,14 @@ Result Par1Repairer::Process(const CommandLine &comman
  10. if (!CreateTargetFiles())
  11. return eFileIOError;
  12. +#ifdef HAVE_PLEDGE
  13. + if (pledge("stdio rpath cpath", NULL) == -1)
  14. + {
  15. + cerr << "pledge failed" << endl;
  16. + return eLogicError;
  17. + }
  18. +#endif
  19. +
  20. // Work out which data blocks are available, which need to be recreated,
  21. // and compute the appropriate Reed Solomon matrix.
  22. if (!ComputeRSmatrix())