uClibc-0.9.29-fix-fget_putc.diff 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  1. diff -ur uClibc-0.9.29/libc/inet/rpc/rcmd.c uClibc-0.9.29-patched/libc/inet/rpc/rcmd.c
  2. --- uClibc-0.9.29/libc/inet/rpc/rcmd.c 2007-01-10 11:46:19.000000000 -0600
  3. +++ uClibc-0.9.29-patched/libc/inet/rpc/rcmd.c 2007-05-09 18:05:21.638421151 -0500
  4. @@ -126,7 +126,7 @@
  5. libc_hidden_proto(listen)
  6. libc_hidden_proto(sigsetmask)
  7. libc_hidden_proto(getc_unlocked)
  8. -libc_hidden_proto(__fgetc_unlocked)
  9. +//libc_hidden_proto(fgetc_unlocked)
  10. libc_hidden_proto(fopen)
  11. libc_hidden_proto(fclose)
  12. libc_hidden_proto(fprintf)
  13. diff -ur uClibc-0.9.29/libc/inet/rpc/ruserpass.c uClibc-0.9.29-patched/libc/inet/rpc/ruserpass.c
  14. --- uClibc-0.9.29/libc/inet/rpc/ruserpass.c 2006-03-23 05:14:16.000000000 -0600
  15. +++ uClibc-0.9.29-patched/libc/inet/rpc/ruserpass.c 2007-05-09 18:05:21.638421151 -0500
  16. @@ -63,7 +63,7 @@
  17. libc_hidden_proto(fopen)
  18. libc_hidden_proto(fclose)
  19. libc_hidden_proto(getc_unlocked)
  20. -libc_hidden_proto(__fgetc_unlocked)
  21. +//libc_hidden_proto(__fgetc_unlocked)
  22. #define _(X) (X)
  23. /* #include "ftp_var.h" */
  24. diff -ur uClibc-0.9.29/libc/misc/error/error.c uClibc-0.9.29-patched/libc/misc/error/error.c
  25. --- uClibc-0.9.29/libc/misc/error/error.c 2006-05-04 09:44:13.000000000 -0500
  26. +++ uClibc-0.9.29-patched/libc/misc/error/error.c 2007-05-09 18:05:21.646421810 -0500
  27. @@ -30,11 +30,14 @@
  28. libc_hidden_proto(strerror)
  29. libc_hidden_proto(fprintf)
  30. libc_hidden_proto(exit)
  31. +//#undef putc
  32. libc_hidden_proto(putc)
  33. +libc_hidden_proto(fputc)
  34. libc_hidden_proto(vfprintf)
  35. libc_hidden_proto(fflush)
  36. -libc_hidden_proto(fputc)
  37. -libc_hidden_proto(__fputc_unlocked)
  38. +//#ifdef __UCLIBC_HAS_STDIO_PUTC_MACRO__
  39. +libc_hidden_proto(fputc_unlocked)
  40. +//#endif
  41. /* This variable is incremented each time `error' is called. */
  42. unsigned int error_message_count = 0;
  43. diff -ur uClibc-0.9.29/libc/misc/ttyent/getttyent.c uClibc-0.9.29-patched/libc/misc/ttyent/getttyent.c
  44. --- uClibc-0.9.29/libc/misc/ttyent/getttyent.c 2006-12-07 17:24:02.000000000 -0600
  45. +++ uClibc-0.9.29-patched/libc/misc/ttyent/getttyent.c 2007-05-09 18:05:21.646421810 -0500
  46. @@ -44,8 +44,10 @@
  47. libc_hidden_proto(__fsetlocking)
  48. libc_hidden_proto(rewind)
  49. libc_hidden_proto(fgets_unlocked)
  50. +//#undef getc_unlocked
  51. libc_hidden_proto(getc_unlocked)
  52. -libc_hidden_proto(__fgetc_unlocked)
  53. +//#undef fgetc_unlocked
  54. +libc_hidden_proto(fgetc_unlocked)
  55. libc_hidden_proto(fopen)
  56. libc_hidden_proto(fclose)
  57. libc_hidden_proto(abort)
  58. diff -ur uClibc-0.9.29/libc/pwd_grp/pwd_grp.c uClibc-0.9.29-patched/libc/pwd_grp/pwd_grp.c
  59. --- uClibc-0.9.29/libc/pwd_grp/pwd_grp.c 2007-04-13 03:32:18.000000000 -0500
  60. +++ uClibc-0.9.29-patched/libc/pwd_grp/pwd_grp.c 2007-05-09 18:05:21.638421151 -0500
  61. @@ -43,11 +43,12 @@
  62. libc_hidden_proto(strtoul)
  63. libc_hidden_proto(rewind)
  64. libc_hidden_proto(fgets_unlocked)
  65. -libc_hidden_proto(__fputc_unlocked)
  66. libc_hidden_proto(sprintf)
  67. libc_hidden_proto(fopen)
  68. libc_hidden_proto(fclose)
  69. libc_hidden_proto(fprintf)
  70. +//#undef fputc_unlocked
  71. +libc_hidden_proto(fputc_unlocked)
  72. #ifdef __UCLIBC_HAS_XLOCALE__
  73. libc_hidden_proto(__ctype_b_loc)
  74. #elif __UCLIBC_HAS_CTYPE_TABLES__
  75. @@ -801,7 +802,7 @@
  76. do {
  77. if (!*m) {
  78. - if (__fputc_unlocked('\n', f) >= 0) {
  79. + if (fputc_unlocked('\n', f) >= 0) {
  80. rv = 0;
  81. }
  82. break;
  83. @@ -867,7 +868,7 @@
  84. goto DO_UNLOCK;
  85. }
  86. - if (__fputc_unlocked('\n', stream) > 0) {
  87. + if (fputc_unlocked('\n', stream) > 0) {
  88. rv = 0;
  89. }
  90. diff -ur uClibc-0.9.29/libc/stdio/_scanf.c uClibc-0.9.29-patched/libc/stdio/_scanf.c
  91. --- uClibc-0.9.29/libc/stdio/_scanf.c 2007-01-20 12:32:10.000000000 -0600
  92. +++ uClibc-0.9.29-patched/libc/stdio/_scanf.c 2007-05-09 18:05:21.642421481 -0500
  93. @@ -86,7 +86,8 @@
  94. libc_hidden_proto(vsscanf)
  95. libc_hidden_proto(fclose)
  96. libc_hidden_proto(getc_unlocked)
  97. -libc_hidden_proto(__fgetc_unlocked)
  98. +//#undef fgetc_unlocked
  99. +libc_hidden_proto(fgetc_unlocked)
  100. #ifdef __UCLIBC_HAS_WCHAR__
  101. libc_hidden_proto(wcslen)
  102. libc_hidden_proto(vfwscanf)
  103. diff -ur uClibc-0.9.29/libc/stdio/fgetc.c uClibc-0.9.29-patched/libc/stdio/fgetc.c
  104. --- uClibc-0.9.29/libc/stdio/fgetc.c 2006-01-15 16:41:03.000000000 -0600
  105. +++ uClibc-0.9.29-patched/libc/stdio/fgetc.c 2007-05-09 18:05:21.642421481 -0500
  106. @@ -13,13 +13,13 @@
  107. #undef getc
  108. #undef getc_unlocked
  109. -libc_hidden_proto(__fgetc_unlocked)
  110. +libc_hidden_proto(fgetc_unlocked)
  111. #ifdef __DO_UNLOCKED
  112. libc_hidden_proto(fflush_unlocked)
  113. -int __fgetc_unlocked(FILE *stream)
  114. +int fgetc_unlocked(FILE *stream)
  115. {
  116. __STDIO_STREAM_VALIDATE(stream);
  117. @@ -73,26 +73,22 @@
  118. return EOF;
  119. }
  120. -libc_hidden_def(__fgetc_unlocked)
  121. -
  122. -libc_hidden_proto(fgetc_unlocked)
  123. -strong_alias(__fgetc_unlocked,fgetc_unlocked)
  124. libc_hidden_def(fgetc_unlocked)
  125. //libc_hidden_proto(__getc_unlocked)
  126. -//strong_alias(__fgetc_unlocked,__getc_unlocked)
  127. +//strong_alias(fgetc_unlocked,__getc_unlocked)
  128. //libc_hidden_def(__getc_unlocked)
  129. libc_hidden_proto(getc_unlocked)
  130. -strong_alias(__fgetc_unlocked,getc_unlocked)
  131. +strong_alias(fgetc_unlocked,getc_unlocked)
  132. libc_hidden_def(getc_unlocked)
  133. #ifndef __UCLIBC_HAS_THREADS__
  134. libc_hidden_proto(fgetc)
  135. -strong_alias(__fgetc_unlocked,fgetc)
  136. +strong_alias(fgetc_unlocked,fgetc)
  137. libc_hidden_def(fgetc)
  138. -strong_alias(__fgetc_unlocked,getc)
  139. +strong_alias(fgetc_unlocked,getc)
  140. #endif
  141. #elif defined __UCLIBC_HAS_THREADS__
  142. diff -ur uClibc-0.9.29/libc/stdio/fgets.c uClibc-0.9.29-patched/libc/stdio/fgets.c
  143. --- uClibc-0.9.29/libc/stdio/fgets.c 2006-01-15 16:41:03.000000000 -0600
  144. +++ uClibc-0.9.29-patched/libc/stdio/fgets.c 2007-05-09 18:05:21.638421151 -0500
  145. @@ -10,8 +10,7 @@
  146. libc_hidden_proto(fgets_unlocked)
  147. #ifdef __DO_UNLOCKED
  148. -
  149. -libc_hidden_proto(__fgetc_unlocked)
  150. +libc_hidden_proto(fgetc_unlocked)
  151. char *fgets_unlocked(char *__restrict s, int n,
  152. register FILE * __restrict stream)
  153. @@ -38,7 +37,7 @@
  154. break;
  155. }
  156. } else {
  157. - if ((c = __fgetc_unlocked(stream)) == EOF) {
  158. + if ((c = fgetc_unlocked(stream)) == EOF) {
  159. if (__FERROR_UNLOCKED(stream)) {
  160. goto ERROR;
  161. }
  162. diff -ur uClibc-0.9.29/libc/stdio/fputc.c uClibc-0.9.29-patched/libc/stdio/fputc.c
  163. --- uClibc-0.9.29/libc/stdio/fputc.c 2007-04-14 12:03:18.000000000 -0500
  164. +++ uClibc-0.9.29-patched/libc/stdio/fputc.c 2007-05-09 20:50:51.350629927 -0500
  165. @@ -16,7 +16,7 @@
  166. #ifdef __DO_UNLOCKED
  167. -int __fputc_unlocked(int c, register FILE *stream)
  168. +int fputc_unlocked(int c, register FILE *stream)
  169. {
  170. __STDIO_STREAM_VALIDATE(stream);
  171. @@ -70,22 +70,22 @@
  172. BAD:
  173. return EOF;
  174. }
  175. -libc_hidden_def(__fputc_unlocked)
  176. +libc_hidden_def(fputc_unlocked)
  177. /* exposing these would be fundamentally *wrong*! fix you, instead! */
  178. /* libc_hidden_proto(fputc_unlocked) */
  179. -strong_alias(__fputc_unlocked,fputc_unlocked)
  180. +/* strong_alias(__fputc_unlocked,fputc_unlocked) */
  181. /* exposing these would be fundamentally *wrong*! fix you, instead! */
  182. /* libc_hidden_def(fputc_unlocked) */
  183. libc_hidden_proto(putc_unlocked)
  184. -strong_alias(__fputc_unlocked,putc_unlocked)
  185. +strong_alias(fputc_unlocked,putc_unlocked)
  186. libc_hidden_def(putc_unlocked)
  187. #ifndef __UCLIBC_HAS_THREADS__
  188. -strong_alias(__fputc_unlocked,fputc)
  189. +strong_alias(fputc_unlocked,fputc)
  190. libc_hidden_proto(putc)
  191. -strong_alias(__fputc_unlocked,putc)
  192. +strong_alias(fputc_unlocked,putc)
  193. libc_hidden_def(putc)
  194. #endif
  195. diff -ur uClibc-0.9.29/libc/stdio/getchar.c uClibc-0.9.29-patched/libc/stdio/getchar.c
  196. --- uClibc-0.9.29/libc/stdio/getchar.c 2006-12-19 22:30:25.000000000 -0600
  197. +++ uClibc-0.9.29-patched/libc/stdio/getchar.c 2007-05-09 18:05:21.642421481 -0500
  198. @@ -7,7 +7,8 @@
  199. #include "_stdio.h"
  200. -libc_hidden_proto(__fgetc_unlocked)
  201. +//#undef fgetc_unlocked
  202. +libc_hidden_proto(fgetc_unlocked)
  203. #undef getchar
  204. #ifdef __DO_UNLOCKED
  205. diff -ur uClibc-0.9.29/libc/stdio/getdelim.c uClibc-0.9.29-patched/libc/stdio/getdelim.c
  206. --- uClibc-0.9.29/libc/stdio/getdelim.c 2006-02-13 02:52:46.000000000 -0600
  207. +++ uClibc-0.9.29-patched/libc/stdio/getdelim.c 2007-05-09 18:05:21.642421481 -0500
  208. @@ -11,8 +11,8 @@
  209. #include "_stdio.h"
  210. libc_hidden_proto(getdelim)
  211. -
  212. -libc_hidden_proto(__fgetc_unlocked)
  213. +//#undef fgetc_unlocked
  214. +libc_hidden_proto(fgetc_unlocked)
  215. /* Note: There is a defect in this function. (size_t vs ssize_t). */
  216. diff -ur uClibc-0.9.29/libc/stdio/old_vfprintf.c uClibc-0.9.29-patched/libc/stdio/old_vfprintf.c
  217. --- uClibc-0.9.29/libc/stdio/old_vfprintf.c 2006-01-22 13:35:08.000000000 -0600
  218. +++ uClibc-0.9.29-patched/libc/stdio/old_vfprintf.c 2007-05-09 18:05:21.642421481 -0500
  219. @@ -149,7 +149,8 @@
  220. libc_hidden_proto(strnlen)
  221. libc_hidden_proto(memcpy)
  222. libc_hidden_proto(putc_unlocked)
  223. -libc_hidden_proto(__fputc_unlocked)
  224. +//#undef fputc_unlocked
  225. +libc_hidden_proto(fputc_unlocked)
  226. libc_hidden_proto(__glibc_strerror_r)
  227. /* #undef __UCLIBC_HAS_FLOATS__ */
  228. diff -ur uClibc-0.9.29/libc/stdio/putchar.c uClibc-0.9.29-patched/libc/stdio/putchar.c
  229. --- uClibc-0.9.29/libc/stdio/putchar.c 2006-01-13 18:58:03.000000000 -0600
  230. +++ uClibc-0.9.29-patched/libc/stdio/putchar.c 2007-05-09 18:05:21.642421481 -0500
  231. @@ -7,7 +7,8 @@
  232. #include "_stdio.h"
  233. -libc_hidden_proto(__fputc_unlocked)
  234. +//#undef fputc_unlocked
  235. +libc_hidden_proto(fputc_unlocked)
  236. #undef putchar
  237. #ifdef __DO_UNLOCKED
  238. diff -ur uClibc-0.9.29/libc/stdio/puts.c uClibc-0.9.29-patched/libc/stdio/puts.c
  239. --- uClibc-0.9.29/libc/stdio/puts.c 2006-01-13 18:58:03.000000000 -0600
  240. +++ uClibc-0.9.29-patched/libc/stdio/puts.c 2007-05-09 18:05:21.642421481 -0500
  241. @@ -7,7 +7,8 @@
  242. #include "_stdio.h"
  243. -libc_hidden_proto(__fputc_unlocked)
  244. +//#undef fputc_unlocked
  245. +libc_hidden_proto(fputc_unlocked)
  246. libc_hidden_proto(fputs_unlocked)
  247. int puts(register const char * __restrict s)
  248. @@ -25,7 +26,7 @@
  249. /* Note: Nonportable as fputs need only return nonnegative on success. */
  250. if ((n = fputs_unlocked(s, stream)) != EOF) {
  251. ++n;
  252. - if (__fputc_unlocked('\n', stream) == EOF) {
  253. + if (fputc_unlocked('\n', stream) == EOF) {
  254. n = EOF;
  255. }
  256. }
  257. diff -ur uClibc-0.9.29/libc/stdio/putwchar.c uClibc-0.9.29-patched/libc/stdio/putwchar.c
  258. --- uClibc-0.9.29/libc/stdio/putwchar.c 2006-01-14 14:16:19.000000000 -0600
  259. +++ uClibc-0.9.29-patched/libc/stdio/putwchar.c 2007-05-09 18:05:21.642421481 -0500
  260. @@ -22,7 +22,8 @@
  261. #elif defined __UCLIBC_HAS_THREADS__
  262. -libc_hidden_proto(__fputc_unlocked)
  263. +//#undef fputc_unlocked
  264. +libc_hidden_proto(fputc_unlocked)
  265. /* psm: should this be fputwc? */
  266. libc_hidden_proto(fputc)
  267. diff -ur uClibc-0.9.29/libc/sysdeps/linux/common/bits/uClibc_stdio.h uClibc-0.9.29-patched/libc/sysdeps/linux/common/bits/uClibc_stdio.h
  268. --- uClibc-0.9.29/libc/sysdeps/linux/common/bits/uClibc_stdio.h 2007-01-28 07:16:58.000000000 -0600
  269. +++ uClibc-0.9.29-patched/libc/sysdeps/linux/common/bits/uClibc_stdio.h 2007-05-09 20:56:02.408110608 -0500
  270. @@ -381,33 +381,29 @@
  271. # define __FEOF(__stream) __FEOF_UNLOCKED(__stream)
  272. #endif
  273. -extern int __fgetc_unlocked(FILE *__stream);
  274. -extern int __fputc_unlocked(int __c, FILE *__stream);
  275. -
  276. /* First define the default definitions.
  277. They are overridden below as necessary. */
  278. -#define __FGETC_UNLOCKED(__stream) (__fgetc_unlocked)((__stream))
  279. +#define __FGETC_UNLOCKED(__stream) (fgetc_unlocked)((__stream))
  280. #define __FGETC(__stream) (fgetc)((__stream))
  281. -#define __GETC_UNLOCKED_MACRO(__stream) (__fgetc_unlocked)((__stream))
  282. -#define __GETC_UNLOCKED(__stream) (__fgetc_unlocked)((__stream))
  283. +#define __GETC_UNLOCKED_MACRO(__stream) (fgetc_unlocked)((__stream))
  284. +#define __GETC_UNLOCKED(__stream) (fgetc_unlocked)((__stream))
  285. #define __GETC(__stream) (fgetc)((__stream))
  286. -#define __FPUTC_UNLOCKED(__c, __stream) (__fputc_unlocked)((__c),(__stream))
  287. +#define __FPUTC_UNLOCKED(__c, __stream) (fputc_unlocked)((__c),(__stream))
  288. #define __FPUTC(__c, __stream) (fputc)((__c),(__stream))
  289. -#define __PUTC_UNLOCKED_MACRO(__c, __stream) (__fputc_unlocked)((__c),(__stream))
  290. -#define __PUTC_UNLOCKED(__c, __stream) (__fputc_unlocked)((__c),(__stream))
  291. +#define __PUTC_UNLOCKED_MACRO(__c, __stream) (fputc_unlocked)((__c),(__stream))
  292. +#define __PUTC_UNLOCKED(__c, __stream) (fputc_unlocked)((__c),(__stream))
  293. #define __PUTC(__c, __stream) (fputc)((__c),(__stream))
  294. #ifdef __STDIO_GETC_MACRO
  295. -
  296. extern FILE *__stdin; /* For getchar() macro. */
  297. # undef __GETC_UNLOCKED_MACRO
  298. # define __GETC_UNLOCKED_MACRO(__stream) \
  299. ( ((__stream)->__bufpos < (__stream)->__bufgetc_u) \
  300. ? (*(__stream)->__bufpos++) \
  301. - : __fgetc_unlocked(__stream) )
  302. + : fgetc_unlocked(__stream) )
  303. # if 0
  304. /* Classic macro approach. getc{_unlocked} can have side effects. */
  305. @@ -453,20 +449,17 @@
  306. # endif
  307. # endif
  308. -#else
  309. -
  310. #endif /* __STDIO_GETC_MACRO */
  311. #ifdef __STDIO_PUTC_MACRO
  312. -
  313. extern FILE *__stdout; /* For putchar() macro. */
  314. # undef __PUTC_UNLOCKED_MACRO
  315. # define __PUTC_UNLOCKED_MACRO(__c, __stream) \
  316. ( ((__stream)->__bufpos < (__stream)->__bufputc_u) \
  317. ? (*(__stream)->__bufpos++) = (__c) \
  318. - : __fputc_unlocked((__c),(__stream)) )
  319. + : (fputc_unlocked((__c),(__stream)) )
  320. # if 0
  321. /* Classic macro approach. putc{_unlocked} can have side effects.*/
  322. @@ -489,7 +482,8 @@
  323. }) )
  324. # undef __PUTC_UNLOCKED
  325. -# define __PUTC_UNLOCKED(__c, __stream) __FPUTC_UNLOCKED((__c), (__stream))
  326. +# define __PUTC_UNLOCKED(__c, __stream) \
  327. + __FPUTC_UNLOCKED((__c), (__stream))
  328. # ifdef __UCLIBC_HAS_THREADS__
  329. # undef __FPUTC
  330. diff -ur uClibc-0.9.29/libc/unistd/getpass.c uClibc-0.9.29-patched/libc/unistd/getpass.c
  331. --- uClibc-0.9.29/libc/unistd/getpass.c 2006-07-05 05:58:38.000000000 -0500
  332. +++ uClibc-0.9.29-patched/libc/unistd/getpass.c 2007-05-09 18:05:21.642421481 -0500
  333. @@ -36,7 +36,8 @@
  334. libc_hidden_proto(fputs)
  335. libc_hidden_proto(fputc)
  336. libc_hidden_proto(putc)
  337. -libc_hidden_proto(__fputc_unlocked)
  338. +//#undef fputc_unlocked
  339. +libc_hidden_proto(fputc_unlocked)
  340. /* It is desirable to use this bit on systems that have it.
  341. The only bit of terminal state we want to twiddle is echoing, which is