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