This is the mail archive of the
libc-hacker@cygnus.com
mailing list for the glibc project.
fclose behaves different
- To: libc-hacker@cygnus.com
- Subject: fclose behaves different
- From: Thorsten Kukuk <kukuk@suse.de>
- Date: Sun, 11 Apr 1999 19:52:24 +0200
Hello,
I have got an interrested bug report to SuSE:
/* -- begin stupid demo -- */
#include<stdio.h>
int
main(void)
{
FILE *fp=NULL;
fp=fopen("/etc/passwd", "r");
printf("%d\n", fclose(fp));
printf("%d\n", fclose(fp)); /* segfault here */
return 0;
}
/* -- end stupid demo -- */
If I compile this program static, the second fclose returns -1,
if I link it dynamic, I get an seg.fault. Don't know why, but
we should always return the same (-1 or seg.fault).
Thorsten
--
Thorsten Kukuk http://www.suse.de/~kukuk/ kukuk@suse.de
SuSE GmbH Schanzaeckerstr. 10 90443 Nuernberg
Linux is like a Vorlon. It is incredibly powerful, gives terse,
cryptic answers and has a lot of things going on in the background.