aboutsummaryrefslogtreecommitdiffstats
path: root/util-src/pposix.c
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2015-05-06 19:21:29 +0100
committerMatthew Wild <mwild1@gmail.com>2015-05-06 19:21:29 +0100
commita540d613cd08b8feee096d19b727d1f5b2cab507 (patch)
treeac1899833b30b87ea97439f061e9b892bd188367 /util-src/pposix.c
parent8b320cb39f3d22c7af46d33ddfc017a726db30d0 (diff)
parent80bafb72003774e5eb63ef9d3d7960385cfb8c6a (diff)
downloadprosody-a540d613cd08b8feee096d19b727d1f5b2cab507.tar.gz
prosody-a540d613cd08b8feee096d19b727d1f5b2cab507.zip
Merge
Diffstat (limited to 'util-src/pposix.c')
-rw-r--r--util-src/pposix.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/util-src/pposix.c b/util-src/pposix.c
index d797f032..5288b08c 100644
--- a/util-src/pposix.c
+++ b/util-src/pposix.c
@@ -750,7 +750,10 @@ int lc_fallocate(lua_State* L) {
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;
}
}