diff options
author | Matthew Wild <mwild1@gmail.com> | 2015-05-06 19:21:29 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2015-05-06 19:21:29 +0100 |
commit | ec83b2aa91ab9142ad6e7f4d26b0f6d20853e747 (patch) | |
tree | ac1899833b30b87ea97439f061e9b892bd188367 /util-src/pposix.c | |
parent | 150799952b2bb969b2cea28c48f52b9ccad13b2b (diff) | |
parent | d67ec1537ba3d0e41615f43c0afe13828ecc002e (diff) | |
download | prosody-ec83b2aa91ab9142ad6e7f4d26b0f6d20853e747.tar.gz prosody-ec83b2aa91ab9142ad6e7f4d26b0f6d20853e747.zip |
Merge
Diffstat (limited to 'util-src/pposix.c')
-rw-r--r-- | util-src/pposix.c | 5 |
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; } } |