On Sunday, 15 October 2006 15:39, Stefan Seyfried wrote:
> 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 ;-)

That's because I've edited the patch manually. ;-)

This time it should be correct.

---
 resume.c  |    4 +++-
 suspend.c |    4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

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)

-------------------------------------------------------------------------
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

Reply via email to