Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <20050710210612.40137.qmail@web88010.mail.re2.yahoo.com> Date: Sun, 10 Jul 2005 17:06:12 -0400 (EDT) From: Brian Bisaillon Subject: localtime_r segfaults, localtime doesn't... same values passed to each function... To: cygwin AT cygwin DOT com MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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/