diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1996-11-26 09:39:26 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1996-11-26 09:39:26 +0000 |
commit | bd6ddc52daef2a49e8cc7fc210236d6f75917fff (patch) | |
tree | 181a2e9edcb2dd8c227a19ab56ec067f7933d675 /ace | |
parent | 7b844f59e70f35915cca9bddbb0691e10221e468 (diff) | |
download | ATCD-bd6ddc52daef2a49e8cc7fc210236d6f75917fff.tar.gz |
eee
Diffstat (limited to 'ace')
-rw-r--r-- | ace/ACE.cpp | 49 | ||||
-rw-r--r-- | ace/ACE.h | 1 | ||||
-rw-r--r-- | ace/Future.cpp | 4 | ||||
-rw-r--r-- | ace/Log_Msg.cpp | 11 | ||||
-rw-r--r-- | ace/Log_Msg.h | 3 | ||||
-rw-r--r-- | ace/Naming_Context.h | 3 | ||||
-rw-r--r-- | ace/OS.cpp | 18 | ||||
-rw-r--r-- | ace/OS.h | 12 | ||||
-rw-r--r-- | ace/OS.i | 8 | ||||
-rw-r--r-- | ace/README | 1 | ||||
-rw-r--r-- | ace/SOCK_Dgram.cpp | 3 | ||||
-rw-r--r-- | ace/Singleton.cpp | 40 | ||||
-rw-r--r-- | ace/Synch_T.cpp | 2 | ||||
-rw-r--r-- | ace/TTY_IO.cpp | 2 | ||||
-rw-r--r-- | ace/UPIPE_Stream.cpp | 6 | ||||
-rw-r--r-- | ace/config-aix-4.1.x.h | 1 | ||||
-rw-r--r-- | ace/config-hpux-10.x.h | 1 | ||||
-rw-r--r-- | ace/config-mvs.h | 3 | ||||
-rw-r--r-- | ace/config-osf1-3.2.h | 2 | ||||
-rw-r--r-- | ace/config-sunos5.5-sunc++-4.1.h | 2 |
20 files changed, 135 insertions, 37 deletions
diff --git a/ace/ACE.cpp b/ace/ACE.cpp index 5ca941f54ee..73f9ac76c8e 100644 --- a/ace/ACE.cpp +++ b/ace/ACE.cpp @@ -112,11 +112,48 @@ ACE::ldfind (const char *filename, size_t maxlen) { ACE_TRACE ("ACE::ldfind"); - if (ACE_OS::strchr (filename, ACE_DIRECTORY_SEPARATOR_CHAR) != 0) + + char searchfilename[MAXPATHLEN]; + + // Determine, whether the default-suffix for shared libraries needs + // to be appended. + + if (ACE_OS::strstr (filename, ACE_DLL_SUFFIX) != 0) + // Use the filename as provided since it has a suffix. + ACE_OS::strncpy (searchfilename, filename, sizeof searchfilename); + else + { + if (ACE_OS::strlen (filename) + + ACE_OS::strlen (ACE_DLL_SUFFIX) + + 1 >= sizeof searchfilename) + { + errno = ENOMEM; + return -1; + } + else + ::sprintf (searchfilename, "%s%s", filename, ACE_DLL_SUFFIX); + } + + if (ACE_OS::strcmp (searchfilename + + ACE_OS::strlen(searchfilename) - ACE_OS::strlen (ACE_DLL_SUFFIX), + ACE_DLL_SUFFIX)) + ACE_ERROR ((LM_NOTICE, + "CAUTION: improper name for a shared library on this patform: %s\n", + searchfilename)); + + if (ACE_OS::strchr (searchfilename, ACE_DIRECTORY_SEPARATOR_CHAR) != 0) { // Use absolute pathname. - ACE_OS::strncpy (pathname, filename, maxlen); - return 0; + if (ACE_OS::strlen (searchfilename) >= maxlen) + { + errno = ENOMEM; + return -1; + } + else + { + ACE_OS::strncpy (pathname, searchfilename, maxlen); + return 0; + } } else { @@ -126,14 +163,14 @@ ACE::ldfind (const char *filename, if (ld_path != 0 && (ld_path = ACE_OS::strdup (ld_path)) != 0) { // Look at each dynamic lib directory in the search path. - char *path_entry = ACE_OS::strtok (ld_path, + char *path_entry = ACE_OS::strtok (ld_path, ACE_LD_SEARCH_PATH_SEPARATOR_STR); int result = 0; while (path_entry != 0) { - if (ACE_OS::strlen (path_entry) + 1 + ACE_OS::strlen (filename) >= maxlen) + if (ACE_OS::strlen (path_entry) + 1 + ACE_OS::strlen (searchfilename) >= maxlen) { errno = ENOMEM; result = -1; @@ -142,7 +179,7 @@ ACE::ldfind (const char *filename, ACE_OS::sprintf (pathname, "%s%c%s", path_entry, ACE_DIRECTORY_SEPARATOR_CHAR, - filename); + searchfilename); if (ACE_OS::access (pathname, R_OK) == 0) break; diff --git a/ace/ACE.h b/ace/ACE.h index f7f26351315..07410b481df 100644 --- a/ace/ACE.h +++ b/ace/ACE.h @@ -1,7 +1,6 @@ /* -*- C++ -*- */ // $Id$ - // ============================================================================ // // = LIBRARY diff --git a/ace/Future.cpp b/ace/Future.cpp index e95eeb3a860..1e245e8361b 100644 --- a/ace/Future.cpp +++ b/ace/Future.cpp @@ -33,8 +33,8 @@ ACE_Future_Rep<T>::dump (void) const template <class T> ACE_Future_Rep<T>::ACE_Future_Rep (void) - : ref_count_ (0), - value_ (0), + : value_ (0), + ref_count_ (0), value_ready_ (this->value_ready_mutex_) { } diff --git a/ace/Log_Msg.cpp b/ace/Log_Msg.cpp index b29169dc5f9..8c9d8f73d9c 100644 --- a/ace/Log_Msg.cpp +++ b/ace/Log_Msg.cpp @@ -654,7 +654,8 @@ ACE_Log_Msg::log (const char *format_str, int ACE_Log_Msg::log_hexdump (ACE_Log_Priority log_priority, char *buffer, - int size) + int size, + char *text) { char buf[ACE_Log_Record::MAXLOGMSGLEN - ACE_Log_Record::VERBOSE_LEN - 58]; // 58 for the HEXDUMP header; @@ -665,7 +666,13 @@ ACE_Log_Msg::log_hexdump (ACE_Log_Priority log_priority, int len = ACE::format_hexdump (buffer, size, buf, sizeof buf); - int sz = ::sprintf (msg_buf, "HEXDUMP %d bytes", size); + int sz = 0; + + if (text) + sz = ::sprintf (msg_buf, "%s - ", text); + + sz += ::sprintf (msg_buf + sz, "HEXDUMP %d bytes", size); + if (len < size) ::sprintf (msg_buf + sz, " (showing first %d bytes)", len); diff --git a/ace/Log_Msg.h b/ace/Log_Msg.h index 3563c5570db..5af0a8f5349 100644 --- a/ace/Log_Msg.h +++ b/ace/Log_Msg.h @@ -276,7 +276,8 @@ public: int log_hexdump (ACE_Log_Priority log_priority, char *buffer, - int size); + int size, + char *text = 0); // Method to log hex dump. This is useful for debugging. Calls // <log> to do the actual print, but formats first to make the chars // printable. diff --git a/ace/Naming_Context.h b/ace/Naming_Context.h index d705fe5ec5e..4198b786f63 100644 --- a/ace/Naming_Context.h +++ b/ace/Naming_Context.h @@ -314,6 +314,9 @@ private: // The context in which the naming database will be created. }; +// We can't use the ACE_SVC_FACTORY_DECLARE macro here because this +// needs to be in the ACE_Export context rather than the +// ACE_Svc_Export context. extern "C" ACE_Export ACE_Service_Object *_make_ACE_Naming_Context (void); #endif /* ACE_NAMING_CONTEXT_H */ diff --git a/ace/OS.cpp b/ace/OS.cpp index f143553a463..4f1816c1af1 100644 --- a/ace/OS.cpp +++ b/ace/OS.cpp @@ -844,26 +844,25 @@ ACE_OS::thr_create (ACE_THR_FUNC func, p_thr = (thr_id == 0 ? &tmp_thr : thr_id); #if defined (ACE_HAS_SETKIND_NP) + ACE_OSCALL (ACE_ADAPT_RETVAL (::pthread_create (p_thr, attr, func, args), + result), + int, -1, result); + ::pthread_attr_delete (&attr); +#else /* !ACE_HAS_SETKIND_NP */ #if defined (ACE_HAS_THR_C_FUNC) ACE_Thread_Adapter *thread_args; ACE_NEW_RETURN (thread_args, ACE_Thread_Adapter (func, args), -1); - ACE_OSCALL (ACE_ADAPT_RETVAL (::pthread_create (p_thr, attr, + ACE_OSCALL (ACE_ADAPT_RETVAL (::pthread_create (p_thr, &attr, ACE_THR_C_FUNC (&ace_thread_adapter), thread_args), result), int, -1, result); #else - ACE_OSCALL (ACE_ADAPT_RETVAL (::pthread_create (p_thr, attr, func, args), - result), - int, -1, result); -#endif /* ACE_HAS_THR_C_FUNC */ - - ::pthread_attr_delete (&attr); -#else /* !ACE_HAS_SETKIND_NP */ ACE_OSCALL (ACE_ADAPT_RETVAL (::pthread_create (p_thr, &attr, func, args), result), int, -1, result); +#endif /* ACE_HAS_THR_C_FUNC */ ::pthread_attr_destroy (&attr); #endif /* ACE_HAS_SETKIND_NP */ #if defined (ACE_HAS_STHREADS) @@ -1363,9 +1362,8 @@ siginfo_t::siginfo_t (ACE_HANDLE handle) // This is necessary to work around nasty problems with MVS C++. -extern "C" void * +extern "C" void ace_mutex_lock_cleanup_adapter (void *args) { ACE_OS::mutex_lock_cleanup (args); - return 0; } @@ -152,6 +152,12 @@ // depending on whether ANSI/ISO exception handling semantics are // being used). +#if 0 + else if (ACE_LOG_MSG->op_status () == -1) { \ + errno = ACE_LOG_MSG->errnum (); \ + delete POINTER; POINTER = 0; return; +#endif /* 0 */ + #define ACE_NEW(POINTER,CONSTRUCTOR) \ do { POINTER = new CONSTRUCTOR; \ if (POINTER == 0) { errno = ENOMEM; return; }} while (0) @@ -328,7 +334,7 @@ static ACE_Static_Svc_##X ace_static_svc_##X; #define ACE_SVC_FACTORY_DECLARE(X) extern "C" ACE_Svc_Export ACE_Service_Object *_make_##X (void); #define ACE_SVC_INVOKE(X) _make_##X () #define ACE_SVC_NAME(X) _make_##X -#define ACE_SVC_FACTORY_DEFINE(X) ACE_Service_Object *_make_##X () { ACE_TRACE (#X); return new X; } +#define ACE_SVC_FACTORY_DEFINE(X) extern "C" ACE_Service_Object *_make_##X () { ACE_TRACE (#X); return new X; } #if !(defined (ACE_HAS_THREADS) && defined (ACE_HAS_THREAD_SPECIFIC_STORAGE)) #define ACE_TSS_TYPE(T) T @@ -994,6 +1000,8 @@ typedef void (*ACE_SignalHandlerV)(...); #define ACE_LD_SEARCH_PATH "PATH" #define ACE_LD_SEARCH_PATH_SEPARATOR_STR ";" #define ACE_LOGGER_KEY "\\temp\\server_daemon" +#define ACE_DLL_SUFFIX ".dll" + // This will help until we figure out everything: #define NFDBITS 32 // only used in unused functions... // These two may be used for internal flags soon: @@ -1299,6 +1307,7 @@ typedef char TCHAR; #define ACE_LD_SEARCH_PATH "LD_LIBRARY_PATH" #define ACE_LD_SEARCH_PATH_SEPARATOR_STR ":" #define ACE_LOGGER_KEY "/tmp/server_daemon" +#define ACE_DLL_SUFFIX ".so" // Wrapper for NT events on UNIX. struct ACE_event_t @@ -1357,7 +1366,6 @@ extern "C" { #if defined (VXWORKS) #include /**/ <sys/times.h> #else -#include /**/ <sys/param.h> #include /**/ <sys/uio.h> #include /**/ <sys/ipc.h> #include /**/ <sys/shm.h> @@ -136,10 +136,10 @@ extern "C" char *mktemp (char *); #if defined (ACE_HAS_THR_C_FUNC) // This is necessary to work around nasty problems with MVS C++. -extern "C" void *ace_mutex_lock_cleanup_adapter (void *args); -#define ACE_PTHREAD_CLEANUP_PUSH(A) pthread_cleanup_push (ACE_THR_C_FUNC (ace_mutex_lock_cleanup_adapter), (void *) A)); +extern "C" void ace_mutex_lock_cleanup_adapter (void *args); +#define ACE_PTHREAD_CLEANUP_PUSH(A) pthread_cleanup_push (ace_mutex_lock_cleanup_adapter, (void *) A)); #else -#define ACE_PTHREAD_CLEANUP_PUSH(A) pthread_cleanup_push (ACE_THR_FUNC (ACE_OS::mutex_lock_cleanup), (void *) A)); +#define ACE_PTHREAD_CLEANUP_PUSH(A) pthread_cleanup_push (ACE_OS::mutex_lock_cleanup, (void *) A)); #endif /* ACE_HAS_THR_C_FUNC */ #if defined (ACE_HAS_REGEX) @@ -3207,7 +3207,7 @@ ACE_OS::thr_sigsetmask (int how, ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::thr_sigsetmask (how, nsm, osm), ace_result_), int, -1); -#elif defined (ACE_HAS_SETKIND_NP) || defined (ACE_HAS_DCETHREADS) +#elif defined (ACE_LACKS_PTHREAD_THR_SIGSETMASK) // DCE threads have no such function. ACE_NOTSUP_RETURN (-1); #elif defined (ACE_HAS_PTHREADS_1003_DOT_1C) diff --git a/ace/README b/ace/README index d0e1010906c..9b3ca25721c 100644 --- a/ace/README +++ b/ace/README @@ -136,6 +136,7 @@ ACE_LACKS_MSGBUF_T Platform lacks struct msgbuf (e.g., NT and MSV). ACE_LACKS_MSYNC Platform lacks msync() (e.g., Linux) ACE_LACKS_PARAM_H Platform lacks <sys/param.h> (e.g., MVS) ACE_LACKS_POSIX_PROTO Platform lacks POSIX prototypes for certain System V functions like shared memory and message queues. +ACE_LACKS_PTHREAD_THR_SIGSETMASK Platform lacks pthread_thr_sigsetmask (e.g., MVS, HP/UX, and OSF/1 3.2) ACE_LACKS_RECVMSG Platform lacks recvmsg() (e.g., Linux) ACE_LACKS_RPC_H Platform lacks the ONC RPC header files. ACE_LACKS_SBRK Platform lacks a working sbrk() (e.g., Win32 and VxWorks) diff --git a/ace/SOCK_Dgram.cpp b/ace/SOCK_Dgram.cpp index 5005738a653..0df5119b560 100644 --- a/ace/SOCK_Dgram.cpp +++ b/ace/SOCK_Dgram.cpp @@ -23,10 +23,9 @@ ssize_t ACE_SOCK_Dgram::recv (iovec *io_vec, ACE_Addr &addr, int flags) const { ACE_TRACE ("ACE_SOCK_Dgram::recv"); +#if defined (FIONREAD) sockaddr *saddr = (sockaddr *) addr.get_addr (); int addr_len = addr.get_size (); - -#if defined (FIONREAD) u_long inlen; if (ACE_OS::ioctl (this->get_handle (), diff --git a/ace/Singleton.cpp b/ace/Singleton.cpp index 5d6a6e8ea31..4a07aedb70c 100644 --- a/ace/Singleton.cpp +++ b/ace/Singleton.cpp @@ -44,7 +44,25 @@ ACE_Singleton<TYPE, LOCK>::instance (void) ACE_GUARD_RETURN (LOCK, ace_mon, ace_singleton_lock_, 0); if (instance_ == 0) - ACE_NEW_RETURN (instance_, TYPE, 0); + { + // We can replace the following lines with this line once we + // update the macro in OS.h + // ACE_NEW_RETURN (instance_, TYPE, 0); + + instance_ = new TYPE; + if (instance_ == 0) + { + errno = ENOMEM; + return 0; + } + else if (ACE_LOG_MSG->op_status () == -1) + { + errno = ACE_LOG_MSG->errnum (); + delete instance_; + instance_ = 0; + return 0; + } + } } return instance_; @@ -56,7 +74,25 @@ ACE_Singleton<TYPE, LOCK>::instance (void) ACE_GUARD_RETURN (LOCK, ace_mon, (ACE_Singleton<TYPE, LOCK>::ace_singleton_lock_), 0); if (ACE_Singleton<TYPE, LOCK>::instance_ == 0) - ACE_NEW_RETURN ((ACE_Singleton<TYPE, LOCK>::instance_), TYPE, 0); + { + // We can replace the following lines with this line once we + // update the macro in OS.h + // ACE_NEW_RETURN ((ACE_Singleton<TYPE, LOCK>::instance_), TYPE, 0); + + instance_ = new TYPE; + if (instance_ == 0) + { + errno = ENOMEM; + return 0; + } + else if (ACE_LOG_MSG->op_status () == -1) + { + errno = ACE_LOG_MSG->errnum (); + delete instance_; + instance_ = 0; + return 0; + } + } } return ACE_Singleton<TYPE, LOCK>::instance_; diff --git a/ace/Synch_T.cpp b/ace/Synch_T.cpp index fd89d2e26d5..6b7ff67dafe 100644 --- a/ace/Synch_T.cpp +++ b/ace/Synch_T.cpp @@ -310,7 +310,7 @@ ACE_TSS<TYPE>::ts_get (void) const if (this->once_ == 0) { // Insure that we are serialized! - ACE_GUARD_RETURN (ACE_Mutex, ace_mon_2, (ACE_Mutex &) this->keylock_, 0); + ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, (ACE_Thread_Mutex &) this->keylock_, 0); // Use the Double-Check pattern to make sure we only create the // key once! diff --git a/ace/TTY_IO.cpp b/ace/TTY_IO.cpp index 96d63e80618..5a14536b42d 100644 --- a/ace/TTY_IO.cpp +++ b/ace/TTY_IO.cpp @@ -200,6 +200,8 @@ ACE_TTY_IO::control (Control_Mode cmd, } // arg switch #else + cmd = cmd; + arg = arg; ACE_NOTSUP_RETURN (-1); #endif /* ACE_HAS_TERM_IOCTLS */ } diff --git a/ace/UPIPE_Stream.cpp b/ace/UPIPE_Stream.cpp index b4bffcee7ae..8f1b29a8596 100644 --- a/ace/UPIPE_Stream.cpp +++ b/ace/UPIPE_Stream.cpp @@ -14,9 +14,9 @@ ACE_ALLOC_HOOK_DEFINE(ACE_UPIPE_Stream) ACE_UPIPE_Stream::ACE_UPIPE_Stream (void) - : remaining_ (0), - reference_count_ (0), - mb_last_ (0) + : mb_last_ (0), + remaining_ (0), + reference_count_ (0) { ACE_TRACE ("ACE_UPIPE_Stream::ACE_UPIPE_STREAM"); } diff --git a/ace/config-aix-4.1.x.h b/ace/config-aix-4.1.x.h index 3f112248b52..3c3bc4c866d 100644 --- a/ace/config-aix-4.1.x.h +++ b/ace/config-aix-4.1.x.h @@ -91,6 +91,7 @@ #define ACE_HAS_GETRUSAGE // EYE assume it does for now. +#define ACE_LACKS_PTHREAD_THR_SIGSETMASK #define ACE_HAS_DCETHREADS #define ACE_PTHREADS_MAP diff --git a/ace/config-hpux-10.x.h b/ace/config-hpux-10.x.h index ce0578b38ed..7f054b37275 100644 --- a/ace/config-hpux-10.x.h +++ b/ace/config-hpux-10.x.h @@ -60,6 +60,7 @@ #define ACE_HAS_PTHREADS #define ACE_MT_SAFE #define ACE_HAS_SIGINFO_T +#define ACE_LACKS_PTHREAD_THR_SIGSETMASK #define ACE_HAS_SETKIND_NP #define ACE_LACKS_CONDATTR_PSHARED #define ACE_LACKS_SI_ADDR diff --git a/ace/config-mvs.h b/ace/config-mvs.h index d9f7577c58a..c2eb04ab54f 100644 --- a/ace/config-mvs.h +++ b/ace/config-mvs.h @@ -143,6 +143,9 @@ // Platform doesn't have <sys/param.h> #define ACE_LACKS_PARAM_H +// Platform lacks pthread_sigaction +#define ACE_LACKS_PTHREAD_THR_SIGSETMASK + // Platform doesn't have pthread_setsched() and friends. #define ACE_LACKS_SETSCHED diff --git a/ace/config-osf1-3.2.h b/ace/config-osf1-3.2.h index 2bb2ba7ee0a..13e627d3b7a 100644 --- a/ace/config-osf1-3.2.h +++ b/ace/config-osf1-3.2.h @@ -29,6 +29,7 @@ #define ACE_LACKS_THREAD_PROCESS_SCOPING // Platform has non-POSIX setkind and other functions. +#define ACE_LACKS_PTHREAD_THR_SIGSETMASK #define ACE_HAS_SETKIND_NP #define ACE_HAS_PTHREAD_T @@ -96,6 +97,7 @@ // Platform supports POSIX O_NONBLOCK semantics. #define ACE_HAS_POSIX_NONBLOCK +#define ACE_LACKS_PTHREAD_THR_SIGSETMASK // ACE supports POSIX Pthreads. #define ACE_HAS_DCETHREADS diff --git a/ace/config-sunos5.5-sunc++-4.1.h b/ace/config-sunos5.5-sunc++-4.1.h index fe4aaf374fe..cddd6e98604 100644 --- a/ace/config-sunos5.5-sunc++-4.1.h +++ b/ace/config-sunos5.5-sunc++-4.1.h @@ -11,7 +11,7 @@ // Note that SunC++ 4.1 fixes template bugs that prevented earlier // versions from supporting template typedefs correctly. -#define ACE_HAS_TEMPLATE_TYPEDEFS +// #define ACE_HAS_TEMPLATE_TYPEDEFS // Platform supports System V IPC (most versions of UNIX, but not Win32) #define ACE_HAS_SYSV_IPC |