Software /
code /
prosody
Changeset
6642:113d321976b6
util.pposix: Return error from ftruncate if that fails too (but what would we do here?)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 02 May 2015 14:41:56 +0200 |
parents | 6641:b44ebfe81c73 |
children | 6643:127b9f0c6135 |
files | util-src/pposix.c |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/util-src/pposix.c Tue Apr 28 14:19:28 2015 +0100 +++ b/util-src/pposix.c Sat May 02 14:41:56 2015 +0200 @@ -750,7 +750,10 @@ lua_pushstring(L, strerror(ret)); /* posix_fallocate() can leave a bunch of NULs at the end, so we cut that * this assumes that offset == length of the file */ - ftruncate(fileno(f), offset); + if(ftruncate(fileno(f), offset) != 0) { + lua_pushstring(L, strerror(errno)); + return 3; + } return 2; } }