diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-11-19 12:48:05 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-11-19 13:01:37 +0100 |
commit | e5f0aceba796b6ebb84ab1b4a8fde3267e6d3e8d (patch) | |
tree | 00766bf986382371e8c57ac20130ebf0787a7151 /sal/osl | |
parent | 93d550d9e08bd0f38852a7df3cd47dc460d86b1a (diff) |
readwrite_helper.h -> readwrite_helper.hxx
Change-Id: If0d71f0660d60e3bcea4db3906ffe600e00f69f2
Diffstat (limited to 'sal/osl')
-rw-r--r-- | sal/osl/unx/file_misc.cxx | 2 | ||||
-rw-r--r-- | sal/osl/unx/process.cxx | 2 | ||||
-rw-r--r-- | sal/osl/unx/profile.cxx | 2 | ||||
-rw-r--r-- | sal/osl/unx/readwrite_helper.cxx | 16 | ||||
-rw-r--r-- | sal/osl/unx/readwrite_helper.hxx (renamed from sal/osl/unx/readwrite_helper.h) | 17 |
5 files changed, 15 insertions, 24 deletions
diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx index b0fb22a71109..658e0a66c0bf 100644 --- a/sal/osl/unx/file_misc.cxx +++ b/sal/osl/unx/file_misc.cxx @@ -32,7 +32,7 @@ #include "file_path_helper.hxx" #include "file_url.hxx" #include "uunxapi.hxx" -#include "readwrite_helper.h" +#include "readwrite_helper.hxx" #include <sys/types.h> #include <errno.h> diff --git a/sal/osl/unx/process.cxx b/sal/osl/unx/process.cxx index 7b6ec07bc9cf..c6b9d9cd4ab6 100644 --- a/sal/osl/unx/process.cxx +++ b/sal/osl/unx/process.cxx @@ -58,7 +58,7 @@ #include "createfilehandlefromfd.hxx" #include "file_url.hxx" -#include "readwrite_helper.h" +#include "readwrite_helper.hxx" #include "sockimpl.h" #include "secimpl.h" diff --git a/sal/osl/unx/profile.cxx b/sal/osl/unx/profile.cxx index d9f4402abef0..a47bdbc0f3bf 100644 --- a/sal/osl/unx/profile.cxx +++ b/sal/osl/unx/profile.cxx @@ -18,7 +18,7 @@ */ #include "system.h" -#include "readwrite_helper.h" +#include "readwrite_helper.hxx" #include "file_url.hxx" #include <osl/diagnose.h> diff --git a/sal/osl/unx/readwrite_helper.cxx b/sal/osl/unx/readwrite_helper.cxx index 93640ccd98d8..949712862f2b 100644 --- a/sal/osl/unx/readwrite_helper.cxx +++ b/sal/osl/unx/readwrite_helper.cxx @@ -7,12 +7,12 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "readwrite_helper.h" +#include "readwrite_helper.hxx" #include <osl/diagnose.h> #include <system.h> -sal_Bool safeWrite(int fd, void* data, sal_uInt32 dataSize) +bool safeWrite(int fd, void* data, sal_uInt32 dataSize) { sal_Int32 nToWrite = dataSize; unsigned char* dataToWrite = static_cast<unsigned char *>(data); @@ -25,7 +25,7 @@ sal_Bool safeWrite(int fd, void* data, sal_uInt32 dataSize) if ( errno == EINTR ) continue; - return sal_False; + return false; } @@ -34,10 +34,10 @@ sal_Bool safeWrite(int fd, void* data, sal_uInt32 dataSize) dataToWrite += nWritten; } - return sal_True; + return true; } -sal_Bool safeRead( int fd, void* buffer, sal_uInt32 count ) +bool safeRead( int fd, void* buffer, sal_uInt32 count ) { sal_Int32 nToRead = count; unsigned char* bufferForReading = static_cast<unsigned char *>(buffer); @@ -51,19 +51,19 @@ sal_Bool safeRead( int fd, void* buffer, sal_uInt32 count ) if (errno == EINTR) continue; - return sal_False; + return false; } // If we reach the EOF, we consider this a partial transfer and thus // an error. if ( nRead == 0 ) - return sal_False; + return false; nToRead -= nRead; bufferForReading += nRead; } - return sal_True; + return true; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sal/osl/unx/readwrite_helper.h b/sal/osl/unx/readwrite_helper.hxx index 78e1e8de202b..9ffebe5c112d 100644 --- a/sal/osl/unx/readwrite_helper.h +++ b/sal/osl/unx/readwrite_helper.hxx @@ -7,26 +7,17 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef INCLUDED_SAL_OSL_UNX_READWRITE_HELPER_H -#define INCLUDED_SAL_OSL_UNX_READWRITE_HELPER_H +#ifndef INCLUDED_SAL_OSL_UNX_READWRITE_HELPER_HXX +#define INCLUDED_SAL_OSL_UNX_READWRITE_HELPER_HXX #include <sal/types.h> -#ifdef __cplusplus -extern "C" -{ -#endif - -sal_Bool safeWrite( int fd, void* data, sal_uInt32 dataSize ); +bool safeWrite( int fd, void* data, sal_uInt32 dataSize ); // This function *will* read |count| bytes from |fd|, busy looping // if needed. Don't use it when you don't know if you can request enough // data. It will return sal_False for any partial transfer or error. -sal_Bool safeRead( int fd, void* buffer, sal_uInt32 count ); - -#ifdef __cplusplus -} -#endif +bool safeRead( int fd, void* buffer, sal_uInt32 count ); #endif |