110-musl_fixes.patch 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  1. --- a/rpc/types.h
  2. +++ b/rpc/types.h
  3. @@ -79,22 +79,6 @@ typedef unsigned long rpcport_t;
  4. #include <sys/types.h>
  5. #endif
  6. -#ifndef __u_char_defined
  7. -typedef __u_char u_char;
  8. -typedef __u_short u_short;
  9. -typedef __u_int u_int;
  10. -typedef __u_long u_long;
  11. -typedef __quad_t quad_t;
  12. -typedef __u_quad_t u_quad_t;
  13. -typedef __fsid_t fsid_t;
  14. -# define __u_char_defined
  15. -#endif
  16. -#ifndef __daddr_t_defined
  17. -typedef __daddr_t daddr_t;
  18. -typedef __caddr_t caddr_t;
  19. -# define __daddr_t_defined
  20. -#endif
  21. -
  22. #include <sys/time.h>
  23. #include <sys/param.h>
  24. --- a/bindresvport.c
  25. +++ b/bindresvport.c
  26. @@ -39,6 +39,7 @@
  27. #include <sys/types.h>
  28. #include <sys/socket.h>
  29. #include <netinet/in.h>
  30. +#include <netdb.h>
  31. /*
  32. --- a/rpc/netdb.h
  33. +++ b/rpc/netdb.h
  34. @@ -37,12 +37,17 @@
  35. #define _RPC_NETDB_H 1
  36. #include <features.h>
  37. +#include <netdb.h>
  38. #define __need_size_t
  39. #include <stddef.h>
  40. #include "types.h"
  41. +#ifndef NETDB_INTERNAL
  42. +#define NETDB_INTERNAL -1
  43. +#endif
  44. +
  45. __BEGIN_DECLS
  46. struct rpcent
  47. --- a/create_xid.c
  48. +++ b/create_xid.c
  49. @@ -31,7 +31,6 @@
  50. __UCLIBC_MUTEX_STATIC(mylock, PTHREAD_MUTEX_INITIALIZER);
  51. static smallint is_initialized;
  52. -static struct drand48_data __rpc_lrand48_data;
  53. u_long _create_xid (void) attribute_hidden;
  54. u_long _create_xid (void)
  55. @@ -45,11 +44,11 @@ u_long _create_xid (void)
  56. struct timeval now;
  57. gettimeofday (&now, (struct timezone *) 0);
  58. - srand48_r (now.tv_sec ^ now.tv_usec, &__rpc_lrand48_data);
  59. + srand48 (now.tv_sec ^ now.tv_usec);
  60. is_initialized = 1;
  61. }
  62. - lrand48_r (&__rpc_lrand48_data, &res);
  63. + res = lrand48();
  64. __UCLIBC_MUTEX_UNLOCK(mylock);
  65. --- a/clnt_tcp.c
  66. +++ b/clnt_tcp.c
  67. @@ -58,7 +58,7 @@ static char sccsid[] = "@(#)clnt_tcp.c 1
  68. #include <stdio.h>
  69. #include <unistd.h>
  70. #include <rpc/rpc.h>
  71. -#include <sys/poll.h>
  72. +#include <poll.h>
  73. #include <sys/socket.h>
  74. #include <rpc/pmap_clnt.h>
  75. #ifdef USE_IN_LIBIO
  76. --- a/clnt_udp.c
  77. +++ b/clnt_udp.c
  78. @@ -45,7 +45,7 @@ static char sccsid[] = "@(#)clnt_udp.c 1
  79. #include <rpc/rpc.h>
  80. #include <rpc/xdr.h>
  81. #include <rpc/clnt.h>
  82. -#include <sys/poll.h>
  83. +#include <poll.h>
  84. #include <sys/socket.h>
  85. #include <sys/ioctl.h>
  86. #include <netdb.h>
  87. --- a/clnt_unix.c
  88. +++ b/clnt_unix.c
  89. @@ -55,7 +55,7 @@
  90. #include <unistd.h>
  91. #include <rpc/rpc.h>
  92. #include <sys/uio.h>
  93. -#include <sys/poll.h>
  94. +#include <poll.h>
  95. #include <sys/socket.h>
  96. #include <rpc/pmap_clnt.h>
  97. #ifdef USE_IN_LIBIO
  98. --- a/pmap_rmt.c
  99. +++ b/pmap_rmt.c
  100. @@ -48,7 +48,7 @@ static char sccsid[] = "@(#)pmap_rmt.c 1
  101. #include <rpc/pmap_prot.h>
  102. #include <rpc/pmap_clnt.h>
  103. #include <rpc/pmap_rmt.h>
  104. -#include <sys/poll.h>
  105. +#include <poll.h>
  106. #include <sys/socket.h>
  107. #include <stdio.h>
  108. #include <errno.h>
  109. --- a/rcmd.c
  110. +++ b/rcmd.c
  111. @@ -62,9 +62,10 @@ static char sccsid[] = "@(#)rcmd.c 8.3 (
  112. #define __UCLIBC_HIDE_DEPRECATED__
  113. #include <features.h>
  114. #include <sys/param.h>
  115. -#include <sys/poll.h>
  116. +#include <poll.h>
  117. #include <sys/socket.h>
  118. #include <sys/stat.h>
  119. +#include <sys/types.h>
  120. #include <netinet/in.h>
  121. #include <arpa/inet.h>
  122. @@ -86,6 +87,11 @@ static char sccsid[] = "@(#)rcmd.c 8.3 (
  123. #endif
  124. #include <sys/uio.h>
  125. +#ifndef _PATH_HEQUIV
  126. +#define _PATH_HEQUIV "/etc/hosts.equiv"
  127. +#endif
  128. +
  129. +int rresvport(int *alport);
  130. /* some forward declarations */
  131. static int __ivaliduser2(FILE *hostf, u_int32_t raddr,
  132. @@ -106,7 +112,7 @@ int rcmd(char **ahost, u_short rport, co
  133. struct hostent *hp;
  134. struct sockaddr_in sin, from;
  135. struct pollfd pfd[2];
  136. - int32_t oldmask;
  137. + sigset_t sig, osig;
  138. pid_t pid;
  139. int s, lport, timo;
  140. char c;
  141. @@ -145,7 +151,9 @@ int rcmd(char **ahost, u_short rport, co
  142. pfd[1].events = POLLIN;
  143. *ahost = hp->h_name;
  144. - oldmask = sigblock(sigmask(SIGURG)); /* __sigblock */
  145. + sigemptyset(&sig);
  146. + sigaddset(&sig, SIGURG);
  147. + sigprocmask(SIG_BLOCK, &sig, &osig);
  148. for (timo = 1, lport = IPPORT_RESERVED - 1;;) {
  149. s = rresvport(&lport);
  150. if (s < 0) {
  151. @@ -154,7 +162,7 @@ int rcmd(char **ahost, u_short rport, co
  152. "rcmd: socket: All ports in use\n");
  153. else
  154. (void)fprintf(stderr, "rcmd: socket: %m\n");
  155. - sigsetmask(oldmask); /* sigsetmask */
  156. + sigprocmask(SIG_SETMASK, &osig, NULL);
  157. return -1;
  158. }
  159. fcntl(s, F_SETOWN, pid);
  160. @@ -189,7 +197,7 @@ int rcmd(char **ahost, u_short rport, co
  161. continue;
  162. }
  163. (void)fprintf(stderr, "%s: %m\n", hp->h_name);
  164. - sigsetmask(oldmask); /* __sigsetmask */
  165. + sigprocmask(SIG_SETMASK, &osig, NULL);
  166. return -1;
  167. }
  168. lport--;
  169. @@ -256,14 +264,14 @@ int rcmd(char **ahost, u_short rport, co
  170. }
  171. goto bad2;
  172. }
  173. - sigsetmask(oldmask);
  174. + sigprocmask(SIG_SETMASK, &osig, NULL);
  175. return s;
  176. bad2:
  177. if (lport)
  178. (void)close(*fd2p);
  179. bad:
  180. (void)close(s);
  181. - sigsetmask(oldmask);
  182. + sigprocmask(SIG_SETMASK, &osig, NULL);
  183. return -1;
  184. }
  185. --- a/rpc/compat.h
  186. +++ b/rpc/compat.h
  187. @@ -11,7 +11,7 @@
  188. #define __UCLIBC_HAS_THREADS__
  189. #endif
  190. -#include <sys/poll.h>
  191. +#include <poll.h>
  192. #include <pthread.h>
  193. #ifdef __UCLIBC__
  194. --- a/rpc_commondata.c
  195. +++ b/rpc_commondata.c
  196. @@ -27,7 +27,7 @@
  197. * Mountain View, California 94043
  198. */
  199. #include <rpc/rpc.h>
  200. -#include <sys/poll.h>
  201. +#include <poll.h>
  202. #include <sys/select.h>
  203. #undef svc_fdset
  204. --- a/rtime.c
  205. +++ b/rtime.c
  206. @@ -51,13 +51,16 @@ static char sccsid[] = "@(#)rtime.c 2.2
  207. #include <rpc/rpc.h>
  208. #include <rpc/clnt.h>
  209. #include <sys/types.h>
  210. -#include <sys/poll.h>
  211. +#include <poll.h>
  212. #include <sys/socket.h>
  213. #include <sys/time.h>
  214. #include <rpc/auth_des.h>
  215. #include <errno.h>
  216. #include <netinet/in.h>
  217. +#ifndef IPPORT_TIMESERVER
  218. +#define IPPORT_TIMESERVER 37
  219. +#endif
  220. #define NYEARS (u_long)(1970 - 1900)
  221. #define TOFFSET (u_long)(60*60*24*(365*NYEARS + (NYEARS/4)))
  222. --- a/svc.c
  223. +++ b/svc.c
  224. @@ -44,7 +44,7 @@
  225. #include "rpc_private.h"
  226. #include <rpc/svc.h>
  227. #include <rpc/pmap_clnt.h>
  228. -#include <sys/poll.h>
  229. +#include <poll.h>
  230. /* used by svc_[max_]pollfd */
  231. /* used by svc_fdset */
  232. --- a/svc_run.c
  233. +++ b/svc_run.c
  234. @@ -36,7 +36,7 @@
  235. #include <errno.h>
  236. #include <unistd.h>
  237. -#include <sys/poll.h>
  238. +#include <poll.h>
  239. #include <rpc/rpc.h>
  240. /* used by svc_[max_]pollfd */
  241. --- a/svc_tcp.c
  242. +++ b/svc_tcp.c
  243. @@ -49,7 +49,7 @@ static char sccsid[] = "@(#)svc_tcp.c 1.
  244. #include <string.h>
  245. #include <rpc/rpc.h>
  246. #include <sys/socket.h>
  247. -#include <sys/poll.h>
  248. +#include <poll.h>
  249. #include <errno.h>
  250. #include <stdlib.h>
  251. --- a/svc_unix.c
  252. +++ b/svc_unix.c
  253. @@ -47,7 +47,7 @@
  254. #include <rpc/svc.h>
  255. #include <sys/socket.h>
  256. #include <sys/uio.h>
  257. -#include <sys/poll.h>
  258. +#include <poll.h>
  259. #include <errno.h>
  260. #include <stdlib.h>
  261. --- a/sa_len.c
  262. +++ b/sa_len.c
  263. @@ -20,9 +20,9 @@
  264. #include <features.h>
  265. #include <sys/socket.h>
  266. #include <netinet/in.h>
  267. -#include <netipx/ipx.h>
  268. #include <sys/un.h>
  269. #if 0
  270. +#include <netipx/ipx.h>
  271. #include <netash/ash.h>
  272. #include <netatalk/at.h>
  273. #include <netax25/ax25.h>
  274. @@ -49,13 +49,13 @@ int __libc_sa_len (sa_family_t af)
  275. return sizeof (struct sockaddr_rose);
  276. case AF_PACKET:
  277. return sizeof (struct sockaddr_ll);
  278. + case AF_IPX:
  279. + return sizeof (struct sockaddr_ipx);
  280. #endif
  281. case AF_INET:
  282. return sizeof (struct sockaddr_in);
  283. case AF_INET6:
  284. return sizeof (struct sockaddr_in6);
  285. - case AF_IPX:
  286. - return sizeof (struct sockaddr_ipx);
  287. case AF_LOCAL:
  288. return sizeof (struct sockaddr_un);
  289. }
  290. --- a/xdr_float.c
  291. +++ b/xdr_float.c
  292. @@ -55,7 +55,7 @@ static char sccsid[] = "@(#)xdr_float.c
  293. * This routine works on Suns (Sky / 68000's) and Vaxen.
  294. */
  295. -#define LSW (__FLOAT_WORD_ORDER == __BIG_ENDIAN)
  296. +#define LSW (__BYTE_ORDER == __BIG_ENDIAN)
  297. #ifdef vax