Author: carnold
Date: Mon Mar 13 18:06:18 2006
New Revision: 385712
URL: http://svn.apache.org/viewcvs?rev=385712&view=rev
Log:
Bug LOGCXX-125: Linux tweaks
Modified:
logging/log4cxx/trunk/include/log4cxx/helpers/inputstreamreader.h
logging/log4cxx/trunk/src/fileinputstream.cpp
logging/log4cxx/trunk/src/inputstreamreader.cpp
Modified: logging/log4cxx/trunk/include/log4cxx/helpers/inputstreamreader.h
URL:
http://svn.apache.org/viewcvs/logging/log4cxx/trunk/include/log4cxx/helpers/inputstreamreader.h?rev=385712&r1=385711&r2=385712&view=diff
==============================================================================
--- logging/log4cxx/trunk/include/log4cxx/helpers/inputstreamreader.h (original)
+++ logging/log4cxx/trunk/include/log4cxx/helpers/inputstreamreader.h Mon Mar
13 18:06:18 2006
@@ -49,7 +49,7 @@
*
* @param in The input stream to decorate.
*/
- InputStreamReader(InputStreamPtr& in);
+ InputStreamReader(const InputStreamPtr& in);
/**
* Creates an InputStreamReader that uses the given charset
decoder.
@@ -57,7 +57,7 @@
* @param in The input stream to decorate.
* @param enc The charset decoder to use for the conversion.
*/
- InputStreamReader(InputStreamPtr& in, CharsetDecoderPtr
&enc);
+ InputStreamReader(const InputStreamPtr& in, const
CharsetDecoderPtr &enc);
~InputStreamReader();
Modified: logging/log4cxx/trunk/src/fileinputstream.cpp
URL:
http://svn.apache.org/viewcvs/logging/log4cxx/trunk/src/fileinputstream.cpp?rev=385712&r1=385711&r2=385712&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/fileinputstream.cpp (original)
+++ logging/log4cxx/trunk/src/fileinputstream.cpp Mon Mar 13 18:06:18 2006
@@ -65,15 +65,15 @@
int FileInputStream::read(ByteBuffer& buf) {
apr_size_t bytesRead = buf.remaining();
- apr_status_t stat = apr_file_read(fileptr, buf.current(), &bytesRead);
- if (APR_STATUS_IS_EOF(stat)) {
- bytesRead = -1;
- } else {
+ apr_status_t stat = apr_file_read(fileptr, buf.current(), &bytesRead);
+ int retval = -1;
+ if (!APR_STATUS_IS_EOF(stat)) {
if (stat != APR_SUCCESS) {
throw IOException(stat);
}
buf.position(buf.position() + bytesRead);
+ retval = bytesRead;
}
- return bytesRead;
+ return retval;
}
Modified: logging/log4cxx/trunk/src/inputstreamreader.cpp
URL:
http://svn.apache.org/viewcvs/logging/log4cxx/trunk/src/inputstreamreader.cpp?rev=385712&r1=385711&r2=385712&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/inputstreamreader.cpp (original)
+++ logging/log4cxx/trunk/src/inputstreamreader.cpp Mon Mar 13 18:06:18 2006
@@ -24,14 +24,14 @@
IMPLEMENT_LOG4CXX_OBJECT(InputStreamReader)
-InputStreamReader::InputStreamReader(InputStreamPtr& in)
+InputStreamReader::InputStreamReader(const InputStreamPtr& in)
: in(in), dec(CharsetDecoder::getDefaultDecoder()) {
if (in == 0) {
throw NullPointerException("in parameter may not be null.");
}
}
-InputStreamReader::InputStreamReader(InputStreamPtr& in, CharsetDecoderPtr
&dec)
+InputStreamReader::InputStreamReader(const InputStreamPtr& in, const
CharsetDecoderPtr &dec)
: in(in), dec(dec) {
if (in == 0) {
throw NullPointerException("in parameter may not be null.");