[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: lfs (CVS version) compilation error under Ununtu-9.04 Jaunty
- From: Leo Razoumov <slonik.az@...>
- Date: Thu, 2 Jul 2009 17:02:21 -0400 (EDT)
Unfortunately, lfs CVS version (src/lfs.c revision 1.60) does not compile under
Linux Ubuntu-9.04 (jaunty) x86, kernel 2.6.28, gcc-4.3.3, glibc-2.9.
src/lfs.c: In function ʽlfs_lock_dirʼ:
src/lfs.c:278: error: ʽstruct statʼ has no member named ʽst_mtimespecʼ
gcc -O2 -I/pkg/lua-5.1.4.LR2/include -c src/lfs.c -o src/lfs.o
Error: Build error: Build error
Indeed, neither /usr/include/sys/stat.h nor /usr/include/bits/stat.h define
st_mtimespec member of struct stat. POSIX compliant name should be st_mtime.
Simple patch below fixed the problem for me.
--Leo--
--------%<--------%<--------%<--------
diff --git a/src/lfs.c b/src/lfs.c
index 13562ee..d96ca38 100644
--- a/src/lfs.c
+++ b/src/lfs.c
@@ -275,7 +275,7 @@ static int lfs_lock_dir(lua_State *L) {
while(symlink(tmpln, ln) == -1) {
if(errno == EEXIST) {
if(lstat(ln, &statbuf) == -1) goto fail;
- if(time(NULL) - statbuf.st_mtimespec.tv_sec > expires) {
+ if(time(NULL) - statbuf.st_mtime > expires) {
unlink(ln);
continue;
}
-------->%-------->%-------->%--------