1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

In test_quota.c, provide a work-around for the missing _chsize_s() function

in mingw.

FossilOrigin-Name: 6b4979e86c05f2da2c5fff67ea7feec5fa56756a
This commit is contained in:
drh
2012-11-06 18:41:41 +00:00
parent 24aeee17a1
commit 46f7d98c0c
3 changed files with 14 additions and 8 deletions

View File

@@ -1179,7 +1179,13 @@ int sqlite3_quota_ftruncate(quota_FILE *p, sqlite3_int64 szNew){
rc = ftruncate(fileno(p->f), szNew);
#endif
#if SQLITE_OS_WIN
rc = _chsize_s(_fileno(p->f), szNew);
# if defined(__MINGW32__) && defined(SQLITE_TEST)
/* _chsize_s() is missing from MingW (as of 2012-11-06). Use
** _chsize() as a work-around for testing purposes. */
rc = _chsize(_fileno(p->f), (long)szNew);
# else
rc = _chsize_s(_fileno(p->f), szNew);
# endif
#endif
if( pFile && rc==0 ){
quotaGroup *pGroup = pFile->pGroup;