[uClibc]stderr problem

dag4004 dag4004 at free.fr
Wed Aug 28 08:27:59 UTC 2002


Hello,

I expected a problem with that test prog :

#include <stdio.h>
#include <stdlib.h>

int main(void)
{
	FILE *f;
	
	printf("Trace 1\n");
	f = freopen("stderr.out", "w", stderr);
	printf("Trace 2\n");
	fprintf(f, "Bonjour");
	printf("Trace 3\n");
	fclose(f);
	printf("Trace 4\n");
	fprintf(stderr, "Erreur");
	printf("Trace 5\n");
	return 0;	
} 

I run it and i have this out put :
Trace 1
Trace 2
Trace 3
Trace 4
--> core dump

It seems that when we close the file f, stderr is lost.
What can i do ?

Thanks for all.
Damien






More information about the uClibc mailing list