2 Jul 23:02
lfs (CVS version) compilation error under Ununtu-9.04 Jaunty
Leo Razoumov <slonik.az <at> gmail.com>
2009-07-02 21:02:21 GMT
2009-07-02 21:02:21 GMT
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; } -------->%-------->%-------->%--------
RSS Feed