summaryrefslogtreecommitdiff
path: root/ACE/ace/OS_NS_unistd.cpp
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2007-05-23 13:01:29 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2007-05-23 13:01:29 +0000
commit1d910c905d97b2a91ff470e22a846ad97e295abb (patch)
treeb47f7f4ace200da01e117242cfea9c12d36a9801 /ACE/ace/OS_NS_unistd.cpp
parenta3053deae8c90aa7d3fb4a54fd413c20573642ec (diff)
downloadATCD-1d910c905d97b2a91ff470e22a846ad97e295abb.tar.gz
Wed May 23 13:00:55 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl>
Diffstat (limited to 'ACE/ace/OS_NS_unistd.cpp')
-rw-r--r--ACE/ace/OS_NS_unistd.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/ACE/ace/OS_NS_unistd.cpp b/ACE/ace/OS_NS_unistd.cpp
index 3ef21dacf2a..d7496463d29 100644
--- a/ACE/ace/OS_NS_unistd.cpp
+++ b/ACE/ace/OS_NS_unistd.cpp
@@ -396,14 +396,14 @@ ACE_OS::read_n (ACE_HANDLE handle,
{
size_t temp;
size_t &bytes_transferred = bt == 0 ? temp : *bt;
- ssize_t n;
+ ssize_t n = 0;
for (bytes_transferred = 0;
bytes_transferred < len;
bytes_transferred += n)
{
n = ACE_OS::read (handle,
- (char *) buf + bytes_transferred,
+ (char *) buf + bytes_transferred,
len - bytes_transferred);
if (n == -1 || n == 0)
@@ -520,16 +520,12 @@ ACE_OS::pread (ACE_HANDLE handle,
return -1;
// Go to the correct position
- ACE_OFF_T altered_position = ACE_OS::lseek (handle,
- offset,
- SEEK_SET);
+ ACE_OFF_T altered_position = ACE_OS::lseek (handle, offset, SEEK_SET);
if (altered_position == -1)
return -1;
- ssize_t const bytes_read = ACE_OS::read (handle,
- buf,
- nbytes);
+ ssize_t const bytes_read = ACE_OS::read (handle, buf, nbytes);
if (bytes_read == -1)
return -1;
@@ -676,7 +672,7 @@ ACE_OS::pwrite (ACE_HANDLE handle,
return -1;
return bytes_written;
-# endif /* ACE_HAD_P_READ_WRITE */
+# endif /* ACE_HAS_P_READ_WRITE */
}
int