From patchwork Thu Jan 27 20:23:33 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janne Blomqvist X-Patchwork-Id: 80731 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 69B4EB712B for ; Fri, 28 Jan 2011 07:23:45 +1100 (EST) Received: (qmail 2531 invoked by alias); 27 Jan 2011 20:23:42 -0000 Received: (qmail 2513 invoked by uid 22791); 27 Jan 2011 20:23:40 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-iy0-f175.google.com (HELO mail-iy0-f175.google.com) (209.85.210.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 27 Jan 2011 20:23:35 +0000 Received: by iyj18 with SMTP id 18so1981430iyj.20 for ; Thu, 27 Jan 2011 12:23:33 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.199.212 with SMTP id et20mr1568599ibb.22.1296159813285; Thu, 27 Jan 2011 12:23:33 -0800 (PST) Received: by 10.231.160.68 with HTTP; Thu, 27 Jan 2011 12:23:33 -0800 (PST) In-Reply-To: <4D41BF19.6080608@net-b.de> References: <4D41BF19.6080608@net-b.de> Date: Thu, 27 Jan 2011 22:23:33 +0200 Message-ID: Subject: Re: [Patch, libfortran] PR 47431 Thread-safe ctime/fdate intrinsics From: Janne Blomqvist To: Tobias Burnus Cc: Fortran List , GCC Patches Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On Thu, Jan 27, 2011 at 20:53, Tobias Burnus wrote: > On 01/25/2011 07:16 PM, Janne Blomqvist wrote: >> >> the attached patch makes the ctime and fdate intrinsics thread-safe by >> using ctime_r() if available. >> >> Regtested on x86_64-unknown-linux-gnu, Ok for trunk? > > OK. Thanks for the patch. Do not forget the follow up bit of the patch. Thanks. Committed, with the additional patch on top (not the s/int/size_t/ thing which I fixed in the ttyname_r() patch, thanks for reminding): (Not that I expect HAVE_CTIME will ever be false, since it's part of C89). Sending libgfortran/ChangeLog Sending libgfortran/config.h.in Sending libgfortran/configure Sending libgfortran/configure.ac Sending libgfortran/intrinsics/ctime.c Transmitting file data ..... Committed revision 169338. > > Tobias > > PS: I think PR 47491 and PR 47375 can be closed as fixed. Yes, done. diff --git a/libgfortran/intrinsics/ctime.c b/libgfortran/intrinsics/ctime.c index 5aae95f..2729616 100644 --- a/libgfortran/intrinsics/ctime.c +++ b/libgfortran/intrinsics/ctime.c @@ -45,7 +45,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see static char * ctime_r (const time_t * timep, char * buf __attribute__((unused))) { +#ifdef HAVE_CTIME return ctime (timep); +#else + return NULL; +#endif } #endif