Comparison

util-src/pposix.c @ 6647:0c363fddcdd9

Merge 0.10->trunk
author Kim Alvefur <zash@zash.se>
date Sun, 03 May 2015 18:39:27 +0200
parent 6642:113d321976b6
child 6789:6b180e77c97a
comparison
equal deleted inserted replaced
6636:441f8cb0deec 6647:0c363fddcdd9
748 } else { 748 } else {
749 lua_pushnil(L); 749 lua_pushnil(L);
750 lua_pushstring(L, strerror(ret)); 750 lua_pushstring(L, strerror(ret));
751 /* posix_fallocate() can leave a bunch of NULs at the end, so we cut that 751 /* posix_fallocate() can leave a bunch of NULs at the end, so we cut that
752 * this assumes that offset == length of the file */ 752 * this assumes that offset == length of the file */
753 ftruncate(fileno(f), offset); 753 if(ftruncate(fileno(f), offset) != 0) {
754 lua_pushstring(L, strerror(errno));
755 return 3;
756 }
754 return 2; 757 return 2;
755 } 758 }
756 } 759 }
757 #endif 760 #endif
758 761