Re: [ext2resize] Help !!
Status: Inactive
Brought to you by:
adilger
From: Andreas D. <ad...@tu...> - 2002-02-12 05:45:52
|
On Feb 11, 2002 11:07 -0600, Ricardo Colin wrote: > I'm trying to compile ext2resize-1.1.1-17 on a RedHat Linux 5.2. (kernel > 2.0.36) > > Because of the lack of certain libraries (glibc-2.0) I had to modify > ext2resize sources, until it finally compiled succesfully. > I just modified a little bit config.h, ext2.c and ext2_fs.h (I add some > defines and comment out the lseek definition). I think this is because the return code for llseek is strange. I have the following changes in my CVS tree: Index: llseek.c =================================================================== RCS file: /cvsroot/ext2resize/ext2resize/src/llseek.c,v retrieving revision 1.6 diff -u -r1.6 llseek.c --- llseek.c 10 Oct 2000 18:34:33 -0000 1.6 +++ llseek.c 12 Feb 2002 05:42:26 -0000 @@ -23,17 +23,21 @@ #if HAVE_LSEEK64 #define __USE_LARGEFILE64 #include <unistd.h> -/* I'm not sure if this is the right thing to do, or if it even works */ inline loff_t ext2_llseek (unsigned int fd, loff_t offset, unsigned int whence) { - loff_t ret = lseek64(fd, offset, whence); - return ret != offset; + return lseek64(fd, offset, whence); } #elif HAVE_LLSEEK +/* + * Note that the return value of llseek() appears to be broken. Assume + * that we made it to where we wanted to go, unless we get an error. + * Should really use lseek64() anyways. + */ inline loff_t ext2_llseek (unsigned int fd, loff_t offset, unsigned int whence) { - return llseek(fd, offset, whence); + loff_t result = llseek(fd, offset, whence); + return (result == (loff_t)-1 ? result : offset); } #elif HAVE_LINUX_UNISTD_H @@ -64,7 +68,7 @@ &result, whence); - return (retval == -1 ? (loff_t) retval : result); + return (retval == -1 ? (loff_t) -1 : offset); } #endif /* __i386__ */ Cheers, Andreas -- Andreas Dilger http://sourceforge.net/projects/ext2resize/ http://www-mddsp.enel.ucalgary.ca/People/adilger/ |