mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-03 19:13:49 +00:00
chore(Deps/Acelite): Update to 6.5.10 (#3450)
This commit is contained in:
73
deps/acelite/ace/OS_NS_unistd.cpp
vendored
73
deps/acelite/ace/OS_NS_unistd.cpp
vendored
@@ -13,7 +13,9 @@
|
||||
#include "ace/Object_Manager_Base.h"
|
||||
#include "ace/Auto_Ptr.h"
|
||||
#include "ace/os_include/sys/os_pstat.h"
|
||||
#include "ace/os_include/sys/os_sysctl.h"
|
||||
#if defined (ACE_HAS_SYSCTL)
|
||||
# include "ace/os_include/sys/os_sysctl.h"
|
||||
#endif /* ACE_HAS_SYSCTL */
|
||||
|
||||
#if defined ACE_HAS_VXCPULIB
|
||||
# include "vxCpuLib.h"
|
||||
@@ -71,7 +73,11 @@ ACE_OS::argv_to_string (int argc,
|
||||
{
|
||||
if (argv_p == argv)
|
||||
{
|
||||
#if defined (ACE_HAS_ALLOC_HOOKS)
|
||||
argv_p = (ACE_TCHAR **) ACE_Allocator::instance()->malloc (argc * sizeof (ACE_TCHAR *));
|
||||
#else
|
||||
argv_p = (ACE_TCHAR **) ACE_OS::malloc (argc * sizeof (ACE_TCHAR *));
|
||||
#endif /* ACE_HAS_ALLOC_HOOKS */
|
||||
if (argv_p == 0)
|
||||
{
|
||||
errno = ENOMEM;
|
||||
@@ -82,7 +88,11 @@ ACE_OS::argv_to_string (int argc,
|
||||
argv_p[i] = ACE_OS::strenvdup (argv[i]);
|
||||
if (argv_p[i] == 0)
|
||||
{
|
||||
#if defined (ACE_HAS_ALLOC_HOOKS)
|
||||
ACE_Allocator::instance()->free (argv_p);
|
||||
#else
|
||||
ACE_OS::free (argv_p);
|
||||
#endif /* ACE_HAS_ALLOC_HOOKS */
|
||||
errno = ENOMEM;
|
||||
return 0;
|
||||
}
|
||||
@@ -99,7 +109,11 @@ ACE_OS::argv_to_string (int argc,
|
||||
{
|
||||
if (argv_p == argv)
|
||||
{
|
||||
#if defined (ACE_HAS_ALLOC_HOOKS)
|
||||
argv_p = (ACE_TCHAR **) ACE_Allocator::instance()->malloc (argc * sizeof (ACE_TCHAR *));
|
||||
#else
|
||||
argv_p = (ACE_TCHAR **) ACE_OS::malloc (argc * sizeof (ACE_TCHAR *));
|
||||
#endif /* ACE_HAS_ALLOC_HOOKS */
|
||||
if (argv_p == 0)
|
||||
{
|
||||
errno = ENOMEM;
|
||||
@@ -116,11 +130,20 @@ ACE_OS::argv_to_string (int argc,
|
||||
++quotes;
|
||||
}
|
||||
argv_p[i] =
|
||||
#if defined (ACE_HAS_ALLOC_HOOKS)
|
||||
(ACE_TCHAR *) ACE_Allocator::instance()->malloc ((ACE_OS::strlen (temp) + quotes + 3)
|
||||
* sizeof (ACE_TCHAR));
|
||||
#else
|
||||
(ACE_TCHAR *) ACE_OS::malloc ((ACE_OS::strlen (temp) + quotes + 3)
|
||||
* sizeof (ACE_TCHAR));
|
||||
#endif /* ACE_HAS_ALLOC_HOOKS */
|
||||
if (argv_p[i] == 0)
|
||||
{
|
||||
#if defined (ACE_HAS_ALLOC_HOOKS)
|
||||
ACE_Allocator::instance()->free (argv_p);
|
||||
#else
|
||||
ACE_OS::free (argv_p);
|
||||
#endif /* ACE_HAS_ALLOC_HOOKS */
|
||||
errno = ENOMEM;
|
||||
return 0;
|
||||
}
|
||||
@@ -145,7 +168,11 @@ ACE_OS::argv_to_string (int argc,
|
||||
|
||||
*end = ACE_TEXT ('\0');
|
||||
if (temp != argv[i])
|
||||
#if defined (ACE_HAS_ALLOC_HOOKS)
|
||||
ACE_Allocator::instance()->free (temp);
|
||||
#else
|
||||
ACE_OS::free (temp);
|
||||
#endif /* ACE_HAS_ALLOC_HOOKS */
|
||||
}
|
||||
buf_len += ACE_OS::strlen (argv_p[i]);
|
||||
|
||||
@@ -156,9 +183,15 @@ ACE_OS::argv_to_string (int argc,
|
||||
// Step through all argv params and copy each one into buf; separate
|
||||
// each param with white space.
|
||||
|
||||
#if defined (ACE_HAS_ALLOC_HOOKS)
|
||||
ACE_ALLOCATOR_RETURN (buf,
|
||||
static_cast<ACE_TCHAR*>(ACE_Allocator::instance()->malloc(sizeof(ACE_TCHAR) * (buf_len + 1))),
|
||||
0);
|
||||
#else
|
||||
ACE_NEW_RETURN (buf,
|
||||
ACE_TCHAR[buf_len + 1],
|
||||
0);
|
||||
#endif /* ACE_HAS_ALLOC_HOOKS */
|
||||
|
||||
// Initial null charater to make it a null string.
|
||||
buf[0] = ACE_TEXT ('\0');
|
||||
@@ -168,7 +201,11 @@ ACE_OS::argv_to_string (int argc,
|
||||
{
|
||||
end = ACE_OS::strecpy (end, argv_p[i]);
|
||||
if (argv_p[i] != argv[i])
|
||||
#if defined (ACE_HAS_ALLOC_HOOKS)
|
||||
ACE_Allocator::instance()->free (argv_p[i]);
|
||||
#else
|
||||
ACE_OS::free (argv_p[i]);
|
||||
#endif /* ACE_HAS_ALLOC_HOOKS */
|
||||
|
||||
// Replace the null char that strecpy put there with white
|
||||
// space.
|
||||
@@ -178,7 +215,11 @@ ACE_OS::argv_to_string (int argc,
|
||||
*end = ACE_TEXT ('\0');
|
||||
|
||||
if (argv_p != argv)
|
||||
#if defined (ACE_HAS_ALLOC_HOOKS)
|
||||
ACE_Allocator::instance()->free (argv_p);
|
||||
#else
|
||||
ACE_OS::free (argv_p);
|
||||
#endif /* ACE_HAS_ALLOC_HOOKS */
|
||||
|
||||
// The number of arguments.
|
||||
return argc;
|
||||
@@ -318,7 +359,7 @@ ACE_OS::fork_exec (ACE_TCHAR *argv[])
|
||||
|
||||
switch (result)
|
||||
{
|
||||
case -1:
|
||||
case static_cast<pid_t>(-1):
|
||||
// Error.
|
||||
return -1;
|
||||
case 0:
|
||||
@@ -349,7 +390,7 @@ ACE_OS::fork_exec (ACE_TCHAR *argv[])
|
||||
ACE_OS::exit (errno);
|
||||
}
|
||||
# endif /* ACE_HAS_WCHAR */
|
||||
|
||||
return result;
|
||||
default:
|
||||
// Server process. The fork succeeded.
|
||||
return result;
|
||||
@@ -605,7 +646,7 @@ ACE_OS::pread (ACE_HANDLE handle,
|
||||
|
||||
return bytes_read;
|
||||
|
||||
# endif /* ACE_HAD_P_READ_WRITE */
|
||||
# endif /* ACE_HAS_P_READ_WRITE */
|
||||
}
|
||||
|
||||
ssize_t
|
||||
@@ -808,14 +849,26 @@ ACE_OS::string_to_argv (ACE_TCHAR *buf,
|
||||
// Make sure that the buffer we're copying into is always large
|
||||
// enough.
|
||||
if (cp - buf >= ACE_DEFAULT_ARGV_BUFSIZ)
|
||||
#if defined (ACE_HAS_ALLOC_HOOKS)
|
||||
ACE_ALLOCATOR_RETURN(argp,
|
||||
static_cast<ACE_TCHAR *>(ACE_Allocator::instance()->malloc(sizeof (ACE_TCHAR) * (cp - buf + 1))),
|
||||
-1);
|
||||
#else
|
||||
ACE_NEW_RETURN (argp,
|
||||
ACE_TCHAR[cp - buf + 1],
|
||||
-1);
|
||||
#endif /* ACE_HAS_ALLOC_HOOKS */
|
||||
|
||||
// Make a new argv vector of argc + 1 elements.
|
||||
#if defined (ACE_HAS_ALLOC_HOOKS)
|
||||
ACE_ALLOCATOR_RETURN(argv,
|
||||
static_cast<ACE_TCHAR **>(ACE_Allocator::instance()->malloc(sizeof (ACE_TCHAR*) * (argc + 1))),
|
||||
-1);
|
||||
#else
|
||||
ACE_NEW_RETURN (argv,
|
||||
ACE_TCHAR *[argc + 1],
|
||||
-1);
|
||||
#endif /* ACE_HAS_ALLOC_HOOKS */
|
||||
|
||||
ACE_TCHAR *ptr = buf;
|
||||
|
||||
@@ -855,7 +908,11 @@ ACE_OS::string_to_argv (ACE_TCHAR *buf,
|
||||
if (argv[i] == 0)
|
||||
{
|
||||
if (argp != arg)
|
||||
#if defined (ACE_HAS_ALLOC_HOOKS)
|
||||
ACE_Allocator::instance()->free(argp);
|
||||
#else
|
||||
delete [] argp;
|
||||
#endif /* ACE_HAS_ALLOC_HOOKS */
|
||||
errno = ENOMEM;
|
||||
return -1;
|
||||
}
|
||||
@@ -869,7 +926,11 @@ ACE_OS::string_to_argv (ACE_TCHAR *buf,
|
||||
{
|
||||
if (argp != arg)
|
||||
{
|
||||
#if defined (ACE_HAS_ALLOC_HOOKS)
|
||||
ACE_Allocator::instance()->free(argp);
|
||||
#else
|
||||
delete [] argp;
|
||||
#endif /* ACE_HAS_ALLOC_HOOKS */
|
||||
}
|
||||
|
||||
errno = ENOMEM;
|
||||
@@ -880,7 +941,11 @@ ACE_OS::string_to_argv (ACE_TCHAR *buf,
|
||||
|
||||
if (argp != arg)
|
||||
{
|
||||
#if defined (ACE_HAS_ALLOC_HOOKS)
|
||||
ACE_Allocator::instance()->free(argp);
|
||||
#else
|
||||
delete [] argp;
|
||||
#endif /* ACE_HAS_ALLOC_HOOKS */
|
||||
}
|
||||
|
||||
argv[argc] = 0;
|
||||
|
||||
Reference in New Issue
Block a user