msvcrt: Added _fclose_nolock() implementation.

This commit is contained in:
Iván Matellanes 2014-10-07 13:35:29 +02:00 committed by Alexandre Julliard
parent 1e65a32e26
commit 9fda14a9d6
7 changed files with 20 additions and 7 deletions

View File

@ -794,7 +794,7 @@
@ cdecl _execvpe(str ptr ptr)
@ cdecl _exit(long) MSVCRT__exit
@ cdecl _expand(ptr long)
@ stub _fclose_nolock
@ cdecl _fclose_nolock(ptr) MSVCRT__fclose_nolock
@ cdecl _fcloseall() MSVCRT__fcloseall
@ cdecl _fcvt(double long ptr ptr) MSVCRT__fcvt
@ cdecl _fcvt_s(ptr long double long ptr ptr) MSVCRT__fcvt_s

View File

@ -1142,7 +1142,7 @@
@ cdecl _execvpe(str ptr ptr)
@ cdecl _exit(long) MSVCRT__exit
@ cdecl _expand(ptr long)
@ stub _fclose_nolock
@ cdecl _fclose_nolock(ptr) MSVCRT__fclose_nolock
@ cdecl _fcloseall() MSVCRT__fcloseall
@ cdecl _fcvt(double long ptr ptr) MSVCRT__fcvt
@ cdecl _fcvt_s(ptr long double long ptr ptr) MSVCRT__fcvt_s

View File

@ -461,7 +461,7 @@
@ cdecl _execvpe(str ptr ptr)
@ cdecl _exit(long) MSVCRT__exit
@ cdecl _expand(ptr long)
@ stub _fclose_nolock
@ cdecl _fclose_nolock(ptr) MSVCRT__fclose_nolock
@ cdecl _fcloseall() MSVCRT__fcloseall
@ cdecl _fcvt(double long ptr ptr) MSVCRT__fcvt
@ cdecl _fcvt_s(ptr long double long ptr ptr) MSVCRT__fcvt_s

View File

@ -443,7 +443,7 @@
@ cdecl _execvpe(str ptr ptr)
@ cdecl _exit(long) MSVCRT__exit
@ cdecl _expand(ptr long)
@ stub _fclose_nolock
@ cdecl _fclose_nolock(ptr) MSVCRT__fclose_nolock
@ cdecl _fcloseall() MSVCRT__fcloseall
@ cdecl _fcvt(double long ptr ptr) MSVCRT__fcvt
@ cdecl _fcvt_s(ptr long double long ptr ptr) MSVCRT__fcvt_s

View File

@ -3373,9 +3373,22 @@ int CDECL MSVCRT__putw(int val, MSVCRT_FILE* file)
*/
int CDECL MSVCRT_fclose(MSVCRT_FILE* file)
{
int r, flag;
int ret;
MSVCRT__lock_file(file);
ret = MSVCRT__fclose_nolock(file);
MSVCRT__unlock_file(file);
return ret;
}
/*********************************************************************
* _fclose_nolock (MSVCRT.@)
*/
int CDECL MSVCRT__fclose_nolock(MSVCRT_FILE* file)
{
int r, flag;
flag = file->_flag;
MSVCRT_free(file->_tmpfname);
file->_tmpfname = NULL;
@ -3386,9 +3399,7 @@ int CDECL MSVCRT_fclose(MSVCRT_FILE* file)
MSVCRT_free(file->_base);
r=MSVCRT__close(file->_file);
file->_flag = 0;
MSVCRT__unlock_file(file);
return ((r == -1) || (flag & MSVCRT__IOERR) ? MSVCRT_EOF : 0);
}

View File

@ -926,6 +926,7 @@ MSVCRT_ulong* __cdecl MSVCRT___doserrno(void);
int* __cdecl MSVCRT__errno(void);
char* __cdecl MSVCRT_getenv(const char*);
int __cdecl MSVCRT_fclose(MSVCRT_FILE*);
int __cdecl MSVCRT__fclose_nolock(MSVCRT_FILE*);
void __cdecl MSVCRT_terminate(void);
MSVCRT_FILE* __cdecl MSVCRT__iob_func(void);
MSVCRT_clock_t __cdecl MSVCRT_clock(void);

View File

@ -129,6 +129,7 @@ int __cdecl _vsprintf_p_l(char*,size_t,const char*,_locale_t,__ms_va_list);
void __cdecl clearerr(FILE*);
int __cdecl fclose(FILE*);
int __cdecl _fclose_nolock(FILE*);
int __cdecl feof(FILE*);
int __cdecl ferror(FILE*);
int __cdecl fflush(FILE*);