aboutsummaryrefslogtreecommitdiffstats
path: root/util-src/pposix.c
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2015-05-03 18:39:27 +0200
committerKim Alvefur <zash@zash.se>2015-05-03 18:39:27 +0200
commit8896368c298dc1d009dc56b38919e02b35f3214d (patch)
tree1db58cd52f622c3560457cf589cdc8e6326d28e6 /util-src/pposix.c
parentec503579285d613085de37168feffa3ad9ea793d (diff)
parentf303d3dda826ebe6df8bc8a4534ee674291a4795 (diff)
downloadprosody-8896368c298dc1d009dc56b38919e02b35f3214d.tar.gz
prosody-8896368c298dc1d009dc56b38919e02b35f3214d.zip
Merge 0.10->trunk
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;
}
}