diff options
Diffstat (limited to 'ace/FILE_IO.cpp')
-rw-r--r-- | ace/FILE_IO.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/ace/FILE_IO.cpp b/ace/FILE_IO.cpp index 6f2c57fe50a..a02e38c656d 100644 --- a/ace/FILE_IO.cpp +++ b/ace/FILE_IO.cpp @@ -34,12 +34,10 @@ ACE_FILE_IO::send (size_t n, ...) const ACE_TRACE ("ACE_FILE_IO::send"); va_list argp; size_t total_tuples = n / 2; - ssize_t result; + iovec *iovp; #if defined (ACE_HAS_ALLOCA) - iovec *iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); + iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); #else - iovec *iovp; - ACE_NEW_RETURN (iovp, iovec[total_tuples], -1); #endif /* !defined (ACE_HAS_ALLOCA) */ @@ -51,7 +49,7 @@ ACE_FILE_IO::send (size_t n, ...) const iovp[i].iov_len = va_arg (argp, int); } - result = ACE_OS::writev (this->get_handle (), iovp, total_tuples); + ssize_t result = ACE_OS::writev (this->get_handle (), iovp, total_tuples); #if !defined (ACE_HAS_ALLOCA) delete [] iovp; #endif /* !defined (ACE_HAS_ALLOCA) */ @@ -71,12 +69,10 @@ ACE_FILE_IO::recv (size_t n, ...) const ACE_TRACE ("ACE_FILE_IO::recv"); va_list argp; size_t total_tuples = n / 2; - ssize_t result; + iovec *iovp; #if defined (ACE_HAS_ALLOCA) - iovec *iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); + iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); #else - iovec *iovp; - ACE_NEW_RETURN (iovp, iovec[total_tuples], -1); #endif /* !defined (ACE_HAS_ALLOCA) */ @@ -88,7 +84,7 @@ ACE_FILE_IO::recv (size_t n, ...) const iovp[i].iov_len = va_arg (argp, int); } - result = ACE_OS::readv (this->get_handle (), iovp, total_tuples); + ssize_t result = ACE_OS::readv (this->get_handle (), iovp, total_tuples); #if !defined (ACE_HAS_ALLOCA) delete [] iovp; #endif /* !defined (ACE_HAS_ALLOCA) */ |