mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
FILE backend controls return value of fclose.
This commit is contained in:
parent
06e2025a87
commit
391d844aca
1 changed files with 7 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
|||
/*******************************************************************************
|
||||
|
||||
Copyright(C) Jonas 'Sortie' Termansen 2011, 2012.
|
||||
Copyright(C) Jonas 'Sortie' Termansen 2011, 2012, 2013.
|
||||
|
||||
This file is part of the Sortix C Library.
|
||||
|
||||
|
@ -26,8 +26,12 @@
|
|||
|
||||
extern "C" int fclose(FILE* fp)
|
||||
{
|
||||
int result = fflush(fp);
|
||||
result |= fp->close_func ? fp->close_func(fp->user) : 0;
|
||||
if ( fflush(fp) )
|
||||
{
|
||||
/* TODO: How to report errors here? fclose may need us to return its
|
||||
exact error value, for instance, as with popen/pclose. */;
|
||||
}
|
||||
int result = fp->close_func ? fp->close_func(fp->user) : 0;
|
||||
funregister(fp);
|
||||
if ( fp->free_func )
|
||||
fp->free_func(fp);
|
||||
|
|
Loading…
Add table
Reference in a new issue