diff options
author | unknown <monty@mysql.com> | 2004-05-06 13:42:26 +0300 |
---|---|---|
committer | unknown <monty@mysql.com> | 2004-05-06 13:42:26 +0300 |
commit | 445148f08339db0cc32c5254f31f8629fedd2af0 (patch) | |
tree | 9a75e17ac46c0c2c536c9050f133f4319e09c69e /innobase/os | |
parent | cc7a8d9bed2193dc3d424b19cac456477db6e6f5 (diff) | |
parent | 2d776e36d8dd205efccc18a75292308fd4c5d385 (diff) | |
download | mariadb-git-445148f08339db0cc32c5254f31f8629fedd2af0.tar.gz |
Merge with 4.0 to get security patch for check_grant_colum
innobase/include/os0file.h:
Auto merged
innobase/os/os0file.c:
Auto merged
innobase/srv/srv0srv.c:
Auto merged
mysql-test/r/rpl_server_id2.result:
Auto merged
sql/ha_innodb.cc:
Auto merged
sql/slave.cc:
Merge with 4.0
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 |