On Sun, Oct 15, 2006 at 03:23:05PM +0200, Rafael J. Wysocki wrote: > Hi, > > Now I have something in the brown-paper-bag category. > > Without this patch s2disk on i386 (32-bit in general) doesn't work with > swap files placed above 2 GB from the beginning of the partition. I think > it'll also have a problem with a swap partition larger than 2 GB, but I > haven't > checked this.
It certainly looks obviously correct, although i do not dare to imply that i am competent to review the low-level suspend / resume code :-) > resume.c | 4 +++- > suspend.c | 14 +++++++++++--- > 2 files changed, 14 insertions(+), 4 deletions(-) The diffstat does not seem to match the diff ;-) > Index: suspend/suspend.c > =================================================================== > --- suspend.orig/suspend.c > +++ suspend/suspend.c > @@ -9,6 +9,8 @@ > * > */ > > +#define _LARGEFILE64_SOURCE > + > #include <sys/types.h> > #include <sys/stat.h> > #include <sys/ioctl.h> > @@ -219,7 +221,7 @@ static int write_area(int fd, void *buf, > ssize_t cnt = 0; > > if (offset) { > - if (lseek(fd, offset, SEEK_SET) == offset) > + if (lseek64(fd, offset, SEEK_SET) == offset) > cnt = write(fd, buf, size); > if (cnt == size) > res = 0; > Index: suspend/resume.c > =================================================================== > --- suspend.orig/resume.c > +++ suspend/resume.c > @@ -10,6 +10,8 @@ > */ > > #define _GNU_SOURCE > +#define _LARGEFILE64_SOURCE > + > #include <sys/types.h> > #include <sys/stat.h> > #include <sys/ioctl.h> > @@ -147,7 +149,7 @@ static int read_area(int fd, void *buf, > ssize_t cnt = 0; > > if (offset) { > - if (lseek(fd, offset, SEEK_SET) == offset) > + if (lseek64(fd, offset, SEEK_SET) == offset) > cnt = read(fd, buf, size); > if (cnt < (ssize_t)size) { > if (cnt < 0) -- Stefan Seyfried QA / R&D Team Mobile Devices | "Any ideas, John?" SUSE LINUX Products GmbH, Nürnberg | "Well, surrounding them's out." ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Suspend-devel mailing list Suspend-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/suspend-devel