Mail Archives: cygwin/2005/07/10/17:06:22
This works...
struct tm *sci_localtime (time_t timep) {
struct tm *result;
if ((result = localtime(&timep)) == NULL) {
int errsv = errno;
fprintf (stderr, "\nError Code %i: %s at line
%i of %s function in %s \
\n", strerror (errsv), 2,
"sci_localtime_r", "sci_time.c");
exit (EXIT_FAILURE);
} else {
return (result);
}
}
This doesn't...
struct tm *sci_localtime_r (time_t timep) {
struct tm *result;
if ((localtime_r(&timep, result)) == NULL) {
int errsv = errno;
fprintf (stderr, "\nError Code %i: %s at line
%i of %s function in %s \
\n", strerror (errsv), 2,
"sci_localtime_r", "sci_time.c");
exit (EXIT_FAILURE);
} else {
return (result);
}
}
Keep in mind, I have a wrapper for time() and
asctime_r() and they work just fine. The segfault is
being caused by localtime_r(). I mean I changed it to
localtime() and everything worked. When I change it
back to localtime_r() it doesn't. Anyone ever
encounter this bug? Anyway, I plan to update my Cygwin
DLL to see if it fixes the problem.
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -