projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
399adc4
)
util.pposix: Return error from ftruncate if that fails too (but what would we do...
author
Kim Alvefur
<zash@zash.se>
Sat, 2 May 2015 12:41:56 +0000
(14:41 +0200)
committer
Kim Alvefur
<zash@zash.se>
Sat, 2 May 2015 12:41:56 +0000
(14:41 +0200)
util-src/pposix.c
patch
|
blob
|
history
diff --git
a/util-src/pposix.c
b/util-src/pposix.c
index d797f0329af95907a5153fff02019b2aab7efc69..5288b08cd03217e8c86db35cfa0c16a20027817c 100644
(file)
--- 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;
}
}