summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelliott_c <ocielliottc@users.noreply.github.com>2002-03-14 20:27:29 +0000
committerelliott_c <ocielliottc@users.noreply.github.com>2002-03-14 20:27:29 +0000
commit917dda7d8bf86cb332229b734614961c4fadc523 (patch)
treeeb3d10f0f2302d7fd79c2fbec01c346b3463062e
parenta0109f6c62f7f39aa17f515e6f5878b72c523239 (diff)
downloadATCD-917dda7d8bf86cb332229b734614961c4fadc523.tar.gz
ChangeLogTag: Thu Feb 28 09:55:21 2002 Chad Elliott <elliott_c@ociweb.com>
-rw-r--r--TAO/ChangeLogs/ChangeLog-02a9
-rw-r--r--TAO/examples/Simple/time/Time_Client_i.cpp23
2 files changed, 28 insertions, 4 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a
index 1b04a209c5d..14c3ff087c0 100644
--- a/TAO/ChangeLogs/ChangeLog-02a
+++ b/TAO/ChangeLogs/ChangeLog-02a
@@ -1,3 +1,12 @@
+Thu Feb 28 09:55:21 2002 Chad Elliott <elliott_c@ociweb.com>
+
+ * examples/Simple/time/Time_Client_i.cpp:
+
+ Fix a core dump for 64-bit Solaris and HP-UX. The address of the
+ CORBA::Long (in the call to ctime) needed to be 8 byte aligned and
+ the reentrant version of ctime needed to be used (due to
+ problems on Solaris).
+
Thu Mar 14 14:13:02 2002 Chad Elliott <elliott_c@ociweb.com>
* tests/File_IO/server.cpp:
diff --git a/TAO/examples/Simple/time/Time_Client_i.cpp b/TAO/examples/Simple/time/Time_Client_i.cpp
index 8ec47f9b5c5..0c42b8d1cdd 100644
--- a/TAO/examples/Simple/time/Time_Client_i.cpp
+++ b/TAO/examples/Simple/time/Time_Client_i.cpp
@@ -29,14 +29,29 @@ Time_Client_i::run (const char *name,
ACE_TRY
{
+ // 64-bit OS's require pointers to be aligned on an
+ // 8 byte boundary. 64-bit HP-UX requires a double to do this
+ // while a long does it for 64-bit Solaris.
+#if defined (HPUX)
+ CORBA::Double padding;
+#else
+ CORBA::Long padding;
+#endif /* HPUX */
+ CORBA::Long timedate;
+
+ ACE_UNUSED_ARG (padding);
+
//Make the RMI.
- CORBA::Long timedate = client->current_time (ACE_ENV_SINGLE_ARG_PARAMETER);
+ timedate = client->current_time (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
// Print out value
- char *ascii_timedate =
- ACE_OS::ctime (ACE_reinterpret_cast (time_t *,
- &timedate));
+ // Use ACE_OS::ctime_r(), ctime() doesn't seem to work properly
+ // under 64-bit solaris.
+ ACE_TCHAR ascii_timedate[64] = "";
+ ACE_OS::ctime_r (ACE_reinterpret_cast (const time_t *, &timedate),
+ ascii_timedate, 64);
+
ACE_DEBUG ((LM_DEBUG,
"string time is %s\n",
ascii_timedate));