Bug with Large Files on AIX

Extern.Martin.Schaller at audi.de Extern.Martin.Schaller at audi.de
Wed May 14 22:16:49 EST 2003


Hi,

on AIX, mkstemp doesn't open a file with the O_LARGEFILE option, so you
can't transfer files > 2GB to an AIX machine.

Here is a fix:
diff -c -r rsync-2.5.6.orig/syscall.c rsync-2.5.6/syscall.c
*** rsync-2.5.6.orig/syscall.c  Sun Jan 26 21:09:02 2003
--- rsync-2.5.6/syscall.c       Wed May 14 13:55:15 2003
***************
*** 151,157 ****
        if (dry_run) return -1;
        if (read_only) {errno = EROFS; return -1;}
  
! #if defined(HAVE_SECURE_MKSTEMP) && defined(HAVE_FCHMOD)
        {
                int fd = mkstemp(template);
                if (fd == -1) return -1;
--- 151,157 ----
        if (dry_run) return -1;
        if (read_only) {errno = EROFS; return -1;}
  
! #if defined(HAVE_SECURE_MKSTEMP) && defined(HAVE_FCHMOD) && !defined(_AIX)
        {
                int fd = mkstemp(template);
                if (fd == -1) return -1;
***************
*** 164,170 ****
--- 164,174 ----
        }
  #else
        if (!mktemp(template)) return -1;
+ #if defined(O_LARGEFILE)
+       return do_open(template, O_RDWR|O_EXCL|O_CREAT|O_LARGEFILE, perms);
+ #else
        return do_open(template, O_RDWR|O_EXCL|O_CREAT, perms);
+ #endif
  #endif
  }

Regards,

Martin Schaller



More information about the rsync mailing list