This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/23992] New: fflush() return -1 whith EBADF errno when pass a closed file descriptor after merge commit bcdaad21
- From: "wangfangpeng1 at huawei dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Sat, 15 Dec 2018 14:34:09 +0000
- Subject: [Bug libc/23992] New: fflush() return -1 whith EBADF errno when pass a closed file descriptor after merge commit bcdaad21
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=23992
Bug ID: 23992
Summary: fflush() return -1 whith EBADF errno when pass a
closed file descriptor after merge commit bcdaad21
Product: glibc
Version: 2.28
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: libc
Assignee: unassigned at sourceware dot org
Reporter: wangfangpeng1 at huawei dot com
CC: drepper.fsp at gmail dot com
Target Milestone: ---
Hi
I got the wrong ret value add errno, when call fflush() with a closed file
descriptor arg, after the mainlne merge commit bcdaad21(malloc: tcache double
free check).
This is my testcase:
#include<stdio.h>
#include<errno.h>
#include<unistd.h>
int main(int argc, char const *argv[])
{
FILE *f;
f = fopen("testfile", "w");
fclose(f);
f = fopen("testfile", "r");
fclose(f);
errno = 0;
int ret = fflush(f);
if(ret != 0) {
printf("err! ret=%d errno=%d\n", ret, errno);
return 1;
}
unlink("testfile");
printf("test ok.\n");
return 0;
}
Looking forward to your early reply…
--
You are receiving this mail because:
You are on the CC list for the bug.