diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1997-12-19 23:23:53 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1997-12-19 23:23:53 +0000 |
commit | dce2e92cdcdaf7144db8be339976c24bb3923497 (patch) | |
tree | fa1e1920c5427841a6d7ae6f8f5e031fa15b5576 | |
parent | 092f3e078566f541e977a4ca7310c84e13f65eab (diff) | |
download | ATCD-dce2e92cdcdaf7144db8be339976c24bb3923497.tar.gz |
*** empty log message ***
-rw-r--r-- | ChangeLog-98a | 22 | ||||
-rw-r--r-- | ace/Log_Record.i | 9 | ||||
-rw-r--r-- | ace/OS.i | 8 |
3 files changed, 34 insertions, 5 deletions
diff --git a/ChangeLog-98a b/ChangeLog-98a index c828b40c71b..565c97e7c7e 100644 --- a/ChangeLog-98a +++ b/ChangeLog-98a @@ -1,3 +1,25 @@ +Fri Dec 19 17:16:52 1997 Douglas C. Schmidt <schmidt@flamenco.cs.wustl.edu> + + * ace/Log_Record.i: The time stamp put into the ACE_Log_Record + gets all messed up when the ACE_Log_Record is transmitted to the + Server_Logging_Handler and the client is run on a little-endian + architecture. This is because the ACE_Log_Record::encode method + does: + + this->time_stamp_ = ACE_Time_Value + + htonl (this->time_stamp_.sec ()), + htonl (this->time_stamp_.usec ())); + + When the ACE_Time_Value is passed in the resulting values from + "htonl", it calls "normalize" which totally messes with the + values passed. Thanks to Patrick J. McNerthney + <pat@thememedia.com> for reporting this. + + * ace/OS.i: Fixed ctime_r() so that it doesn't crash if a NULL is + returned from ctime_r(). Thanks to Patrick J. McNerthney + <pat@thememedia.com> for reporting this. + Fri Dec 19 09:44:28 1997 David L. Levine <levine@cs.wustl.edu> * ace/OS.{h,i}: fixed sigwait for DEC cxx, yet again for cxx diff --git a/ace/Log_Record.i b/ace/Log_Record.i index a5164d1f2bb..b1c853d011f 100644 --- a/ace/Log_Record.i +++ b/ace/Log_Record.i @@ -9,8 +9,13 @@ ACE_Log_Record::encode (void) ACE_TRACE ("ACE_Log_Record::encode"); this->length_ = htonl (this->length_); this->type_ = htonl (this->type_); - this->time_stamp_ = ACE_Time_Value (htonl (this->time_stamp_.sec ()), - htonl (this->time_stamp_.usec ())); + this->time_stamp_ = ACE_Time_Value (this->time_stamp_.sec (), + this->time_stamp_.usec ()); + + // Make sure we don't enclose the sec() and usec() fields until + // they've been normalized. + this->time_stamp_.sec (htonl (this->time_stamp_.sec ())); + this->time_stamp_.usec (htonl (this->time_stamp_.usec ())); this->pid_ = htonl (this->pid_); } @@ -6479,12 +6479,13 @@ ACE_OS::ctime_r (const time_t *t, char *buf, int buflen) #else ACE_OSCALL (::ctime_r (t, buf), char *, 0, result); #endif /* DIGITAL_UNIX */ - ::strncpy (buf, result, buflen); + if (result != 0) + ::strncpy (buf, result, buflen); return buf; #else # if defined (ACE_CTIME_R_RETURNS_INT) - return (::ctime_r(t, buf, buflen) == -1 ? 0 : buf); + return (::ctime_r (t, buf, buflen) == -1 ? 0 : buf); # else ACE_OSCALL_RETURN (::ctime_r (t, buf, buflen), char *, 0); # endif /* ACE_CTIME_R_RETURNS_INT */ @@ -6493,7 +6494,8 @@ ACE_OS::ctime_r (const time_t *t, char *buf, int buflen) #else char *result; ACE_OSCALL (::ctime (t), char *, 0, result); - ::strncpy (buf, result, buflen); + if (result != 0) + ::strncpy (buf, result, buflen); return buf; #endif /* defined (ACE_HAS_REENTRANT_FUNCTIONS) */ } |