From patchwork Sat May 4 20:58:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Edelsohn X-Patchwork-Id: 241477 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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 3FF332C00A3 for ; Sun, 5 May 2013 06:58:44 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:content-type; q= dns; s=default; b=YMrkgVOLpdDKjzSo9yYNB8fntM2rPQ48oDC7BJbzKqcCRj VXqahrSEAEusdRTwMFHUfRUvw8mr/q46AqwgJ9OCBYZzEcOjfI+TkDRcC2xclfvW 4w3QNO5I67740VpnhP5KlvSqAAYInbi+H96CDkQKOGEMRRNKyAh99mv+aF9MA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:content-type; s= default; bh=3HxF0MakxHi7Gvy4wYAJZ1KpXPk=; b=N8C+b9Hzf6wczxeI9y9G mZ5sh92as1TZNfazWr764kD6JPRKE5V/Ip51FqsNaKQfoHVPoClCRRdISWLPlgF8 M3u8ON27GdwdeIkp7ndYktqwY2Ddlh3s0v0wfaHrsOs1X9r9a5ZNJwP3qigExYq6 +IXjrxa2Um4xPnmTQc8t4RA= Received: (qmail 14153 invoked by alias); 4 May 2013 20:58:38 -0000 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 Received: (qmail 14115 invoked by uid 89); 4 May 2013 20:58:30 -0000 X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, SPF_PASS, TW_BG autolearn=ham version=3.3.1 X-Spam-User: qpsmtpd, 2 recipients Received: from mail-ve0-f175.google.com (HELO mail-ve0-f175.google.com) (209.85.128.175) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Sat, 04 May 2013 20:58:30 +0000 Received: by mail-ve0-f175.google.com with SMTP id m1so2396297ves.34 for ; Sat, 04 May 2013 13:58:28 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.52.90.112 with SMTP id bv16mr4273255vdb.62.1367701108394; Sat, 04 May 2013 13:58:28 -0700 (PDT) Received: by 10.220.175.131 with HTTP; Sat, 4 May 2013 13:58:28 -0700 (PDT) Date: Sat, 4 May 2013 16:58:28 -0400 Message-ID: Subject: [PATCH, FORTRAN] Include unistd.h in environ.c From: David Edelsohn To: GCC Patches , Fortran List environ.c is referencing functions like getuid(), geteuid(), getgid() and getegid(), but it does not include the header file that declares them. I also noticed that libgfortran is not consistent about checking that unistd.h exists. Bootstrapped on powerpc-ibm-aix7.1.0.0. Okay for trunk? Thanks, David * runtime/pause.c: Test HAVE_UNISTD_H. * runtime/environ.c: Include unistd.h. * runtime/stop.c: Test HAVE_UNISTD_H. Index: runtime/pause.c =================================================================== --- runtime/pause.c (revision 198587) +++ runtime/pause.c (working copy) @@ -25,8 +25,12 @@ #include "libgfortran.h" #include + +#ifdef HAVE_UNISTD_H #include +#endif + static void do_pause (void) { Index: runtime/environ.c =================================================================== --- runtime/environ.c (revision 198587) +++ runtime/environ.c (working copy) @@ -28,7 +28,11 @@ #include #include +#ifdef HAVE_UNISTD_H +#include +#endif + /* Environment scanner. Examine the environment for controlling minor * aspects of the program's execution. Our philosophy here that the * environment should not prevent the program from running, so an Index: runtime/stop.c =================================================================== --- runtime/stop.c (revision 198587) +++ runtime/stop.c (working copy) @@ -26,8 +26,12 @@ #include "libgfortran.h" #include #include + +#ifdef HAVE_UNISTD_H #include +#endif + /* A numeric STOP statement. */ extern void stop_numeric (GFC_INTEGER_4)