100-fix_cross_rpcgen.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. --- a/sunrpc/rpc/types.h
  2. +++ b/sunrpc/rpc/types.h
  3. @@ -75,18 +75,23 @@ typedef unsigned long rpcport_t;
  4. #endif
  5. #ifndef __u_char_defined
  6. -typedef __u_char u_char;
  7. -typedef __u_short u_short;
  8. -typedef __u_int u_int;
  9. -typedef __u_long u_long;
  10. -typedef __quad_t quad_t;
  11. -typedef __u_quad_t u_quad_t;
  12. -typedef __fsid_t fsid_t;
  13. +typedef unsigned char u_char;
  14. +typedef unsigned short u_short;
  15. +typedef unsigned int u_int;
  16. +typedef unsigned long u_long;
  17. +#if __WORDSIZE == 64
  18. +typedef long int quad_t;
  19. +typedef unsigned long int u_quad_t;
  20. +#elif defined __GLIBC_HAVE_LONG_LONG
  21. +typedef long long int quad_t;
  22. +typedef unsigned long long int u_quad_t;
  23. +#endif
  24. +typedef u_quad_t fsid_t;
  25. # define __u_char_defined
  26. #endif
  27. -#ifndef __daddr_t_defined
  28. -typedef __daddr_t daddr_t;
  29. -typedef __caddr_t caddr_t;
  30. +#if !defined(__daddr_t_defined) && defined(linux)
  31. +typedef long int daddr_t;
  32. +typedef char *caddr_t;
  33. # define __daddr_t_defined
  34. #endif
  35. --- a/sunrpc/rpc_main.c
  36. +++ b/sunrpc/rpc_main.c
  37. @@ -958,9 +958,10 @@ mkfile_output (struct commandline *cmd)
  38. abort ();
  39. temp = strrchr (cmd->infile, '.');
  40. cp = stpcpy (mkfilename, "Makefile.");
  41. - if (temp != NULL)
  42. - *((char *) stpncpy (cp, cmd->infile, temp - cmd->infile)) = '\0';
  43. - else
  44. + if (temp != NULL) {
  45. + strncpy(cp, cmd->infile, temp - cmd->infile);
  46. + cp[temp - cmd->infile - 1] = 0;
  47. + } else
  48. stpcpy (cp, cmd->infile);
  49. }