Bugzilla Bug 340956: when emulating PR_APPEND, we should use PR_Seek64 MOZILLA_1_8_BRANCH FIREFOX_2_0b1_RC1 FIREFOX_2_0b1_RC2 FIREFOX_2_0b1_RC3 FIREFOX_2_0b1_RELEASE
authorwtchang%redhat.com
Sun, 11 Jun 2006 03:03:50 +0000
branchMOZILLA_1_8_BRANCH
changeset 3660 97b1216158c05a4c1b41099c6acf1bf76ef04b34
parent 3652 5d2e70ece56ae6c402244825b7f1d1b7e7455210
child 3661 be2b7a16b8e7d9c89fe20844fc3035a6d5dfc92d
child 3667 5b64808b3f46c11af1a25f07948f5171b9654a7e
push idunknown
push userunknown
push dateunknown
bugs340956
Bugzilla Bug 340956: when emulating PR_APPEND, we should use PR_Seek64 instead of PR_Seek, otherwise it won't work on large files. The patch is contributed by Nils Maier <MaierMan@web.de> and Masatoshi Kimura (:emk) <VYV03354@nifty.ne.jp>. r=wtc. Thanks to Nils Maier for tracking down the bug. Tag: MOZILLA_1_8_BRANCH
pr/src/io/prfile.c
--- a/pr/src/io/prfile.c
+++ b/pr/src/io/prfile.c
@@ -94,20 +94,19 @@ static PRInt32 PR_CALLBACK FileWrite(PRF
         PR_SetError(PR_IO_PENDING_ERROR, 0);
 	    rv = -1;
     }
     if (rv != 0)
     	return rv;
 
     count = 0;
 #if !defined(_PR_HAVE_O_APPEND)  /* Bugzilla: 4090, 276330 */
-    if ( PR_TRUE == fd->secret->appendMode ) {
-        rv = PR_Seek(fd, 0, PR_SEEK_END );
-        if ( -1 == rv )  {
-            return rv;
+    if (fd->secret->appendMode) {
+        if (PR_Seek64(fd, 0, PR_SEEK_END) == -1) {
+            return -1;
         }
     } /* if (fd->secret->appendMode...) */
 #endif /* _PR_HAVE_O_APPEND */
     while (amount > 0) {
 		temp = _PR_MD_WRITE(fd, buf, amount);
 		if (temp < 0) {
 			count = -1;
 			break;