diff options
author | Kim Alvefur <zash@zash.se> | 2015-05-03 18:39:27 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2015-05-03 18:39:27 +0200 |
commit | 009cde88a5518e95481126c547bf0b79f95ac797 (patch) | |
tree | 1db58cd52f622c3560457cf589cdc8e6326d28e6 /util-src/pposix.c | |
parent | 86867275492107937cea9b5887de077679bc751d (diff) | |
parent | a7606f77d99c798faa7067331e5b9ac0272c5ad1 (diff) | |
download | prosody-009cde88a5518e95481126c547bf0b79f95ac797.tar.gz prosody-009cde88a5518e95481126c547bf0b79f95ac797.zip |
Merge 0.10->trunk
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; } } |