patch-mvol_c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. $OpenBSD: patch-mvol_c,v 1.2 2017/04/22 02:14:04 jsg Exp $
  2. - Fix multi-volume format cannot handle on 64bit environment
  3. - Add missing includes
  4. - Add non-implicit return type to fix build with clang
  5. --- mvol.c.orig Sun Jan 7 21:47:17 1996
  6. +++ mvol.c Sat Apr 22 11:59:17 2017
  7. @@ -8,6 +8,7 @@
  8. #include <ctype.h>
  9. #include <string.h>
  10. #include <sys/types.h>
  11. +#include <sys/stat.h>
  12. #ifndef NOINDEX
  13. #include <strings.h>
  14. #endif
  15. @@ -17,8 +18,12 @@
  16. #else
  17. #include <dirent.h>
  18. #endif
  19. +#include <stdlib.h>
  20. +#include <unistd.h>
  21. #include "ish.h"
  22. +void restore_done(char *, char *, long);
  23. +
  24. extern unsigned long fsize;
  25. extern unsigned long v_offset;
  26. extern unsigned short max_vol;
  27. @@ -208,10 +213,8 @@ int m,k;
  28. #define COPY_BUF 1024
  29. -restore_done(src, dst,sz)
  30. -char *src;
  31. -char *dst;
  32. -long sz;
  33. +void
  34. +restore_done(char *src, char *dst, long sz)
  35. {
  36. int id;
  37. int od;
  38. @@ -248,7 +251,7 @@ unsigned char *p;
  39. }
  40. close(id);
  41. close(od);
  42. - crc32 = ~crc32;
  43. + crc32 = ~crc32 & 0xffffffffU;
  44. crc16 = ~crc16;
  45. if (crc32 == ncrc32 && crc16 == ncrc16) {
  46. /* checksum OK */