You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2006/01/30 01:34:41 UTC
DO NOT REPLY [Bug 38438] New: - apr_file_seek(file,APR_END,ofs) fails for APR_XTHREAD files
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38438>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=38438
Summary: apr_file_seek(file,APR_END,ofs) fails for APR_XTHREAD
files
Product: APR
Version: 1.2.2
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: normal
Priority: P2
Component: APR
AssignedTo: bugs@httpd.apache.org
ReportedBy: jpihlaja@cc.helsinki.fi
Seeking relative to the end of a file, when the file is opened using
APR_XTHREAD, doesn't as expected. The check for seeking too far back is wrong,
and it would seek in the wrong direction from the end-of-file anyway. Symptoms
include: opening a file in append mode w/APR_XTHREAD, and then writing to it,
results in data being written to the beginning of the file rather than
appending. Possible patch against 1.2.2 below:
diff -rubN apr-1.2.2.orig/file_io/win32/seek.c apr-1.2.2/file_io/win32/seek.c
--- apr-1.2.2.orig/file_io/win32/seek.c 2005-09-09 00:47:13.000000000 +0300
+++ apr-1.2.2/file_io/win32/seek.c 2006-01-30 02:30:19.000000000 +0200
@@ -105,8 +105,8 @@
case APR_END:
rc = apr_file_info_get(&finfo, APR_FINFO_SIZE, thefile);
- if (rc == APR_SUCCESS && finfo.size - *offset < 0)
- thefile->filePtr = finfo.size - *offset;
+ if (rc == APR_SUCCESS && finfo.size + *offset >= 0)
+ thefile->filePtr = finfo.size + *offset;
break;
default:
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
DO NOT REPLY [Bug 38438] - apr_file_seek(file,APR_END,ofs) fails for APR_XTHREAD files
Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38438>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=38438
rooneg@electricjellyfish.net changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Additional Comments From rooneg@electricjellyfish.net 2006-01-30 07:50 -------
Fix committed (with a test I added) in r373453. Will merge into upcoming
release once I confirm it passes on other platforms.
Thanks for the patch!
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org