diff options
author | monty@mysql.com <> | 2004-05-06 13:42:26 +0300 |
---|---|---|
committer | monty@mysql.com <> | 2004-05-06 13:42:26 +0300 |
commit | 28673669a4f76248e712f99b46ac9a76cf2a13d9 (patch) | |
tree | 9a75e17ac46c0c2c536c9050f133f4319e09c69e /innobase/os | |
parent | c150453b429e896f17ef679a3023157c6ebe6b57 (diff) | |
parent | f2991bc41007a8843b09f7e1b1d96061d2279b5d (diff) | |
download | mariadb-git-28673669a4f76248e712f99b46ac9a76cf2a13d9.tar.gz |
Merge with 4.0 to get security patch for check_grant_colum
Diffstat (limited to 'innobase/os')
-rw-r--r-- | innobase/os/os0file.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index ff5b30bec0d..3f14a2158ed 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -1583,6 +1583,23 @@ error_handling: } /*************************************************************************** +Truncates a file at its current position. */ + +ibool +os_file_set_eof( +/*============*/ + /* out: TRUE if success */ + FILE* file) /* in: file to be truncated */ +{ +#ifdef __WIN__ + HANDLE h = (HANDLE) _get_osfhandle(fileno(file)); + return(SetEndOfFile(h)); +#else /* __WIN__ */ + return(!ftruncate(fileno(file), ftell(file))); +#endif /* __WIN__ */ +} + +/*************************************************************************** Flushes the write buffers of a given file to the disk. */ ibool |