Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#101 CRITICAL: ftime usage causes failure on newest OS X

v3.1.2
open-fixed
None
9
2005-10-13
2005-10-04
Michael Macaluso
No

CRITICAL BUG

**Please contact me at mmacaluso@wavecorp.com if you
would like more information on this. Anything that I
can do to expedite a 3.1.3 version, I would be happy to
assist.

On most BSD platforms, the function ftime has been
deprecated with the replacement being the gettimeofday
function. However, OS X has taken this one step
further by removing the symbol from the libcrypto.dylib
(aka, libcrypto.0.9.7.dylib) library. This change,
gotten from the most recent OS X security updates to
10.3 and 10.4, will cause either a runtime dynamic
library undefined symbol error or a compile link error.

Taking the deprecation at its word and switching to
using gettimeofday, we can avoid the above problems as
well as being able to remove the "-lcrypto" flag from
the make file.

As a suggestion, where necessary, switch over to using
gettimeofday instead of ftime and hide the time
retrieval in a new function. More specifically,
perform the following changes and that should suffice
for most (if not all) platforms:

1) in wrapper.c:
1a) add at line 436:
void wrapperGetCurrentTime(struct timeb *timeBuffer) {
#ifdef WIN32
ftime(&timeBuffer);
#else
struct timeval tv;
gettimeofday(&tv, NULL);
timeBuffer->time = (time_t) tv.tv_sec;
timeBuffer->millitm = (unsigned short) (tv.tv_usec /
1000);
#endif
}

1b) change all uses of ftime to wrapperGetCurrentTime.

2) in wrapper_unix.c:
2a) add at line 378:
extern void wrapperGetCurrentTime(struct timeb
*timeBuffer);

2b) change all uses of ftime to wrapperGetCurrentTime.

3) in Makefile.macosx:
3a) Remove the "-lcrypto" link setting.

Discussion

    • priority: 5 --> 9
     
  • Leif Mortenson
    Leif Mortenson
    2005-10-13

    • assigned_to: nobody --> mortenson
    • status: open --> open-fixed
     
  • Leif Mortenson
    Leif Mortenson
    2005-10-13

    Logged In: YES
    user_id=228081

    This has been fixed for the 3.2.0 release and is in CVS. I
    am really overdue for a release but getting everything tied
    up and tested has been taking more time than I have lately.
    I will try to get it out as soon as possible, but I would
    suggest building from source for the time being.

    Cheers,
    Leif