From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6582 invoked by alias); 9 Mar 2005 19:20:34 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 6478 invoked from network); 9 Mar 2005 19:20:27 -0000 Received: from unknown (HELO sethra.codesourcery.com) (65.74.133.9) by sourceware.org with SMTP; 9 Mar 2005 19:20:27 -0000 Received: from sethra.codesourcery.com (localhost.localdomain [127.0.0.1]) by sethra.codesourcery.com (8.12.11/8.12.11) with ESMTP id j29JKRcC007739 for ; Wed, 9 Mar 2005 11:20:27 -0800 Received: (from mitchell@localhost) by sethra.codesourcery.com (8.12.11/8.12.11/Submit) id j29JKRRM007735; Wed, 9 Mar 2005 11:20:27 -0800 Date: Wed, 09 Mar 2005 19:20:00 -0000 Message-Id: <200503091920.j29JKRRM007735@sethra.codesourcery.com> From: Mark Mitchell To: gdb-patches@sources.redhat.com Subject: PATCH: Avoid using S_IRGRP, etc., on Windows Reply-to: mark@codesourcery.com X-SW-Source: 2005-03/txt/msg00152.txt.bz2 Windows doesn't define all of the permissions macros (e.g., S_IRGRP) because its filesystems don't have that concept. This patch checks that the macros are defined before trying to use them. OK? -- Mark Mitchell CodeSourcery, LLC mark@codesourcery.com 2005-03-09 Mark Mitchell * remote-fileo.c (remote_fileio_mode_to_host): Accomodate lack of S_IRGRP and related macros. (remote_fileio_mode_to_target): Likewise. Index: remote-fileio.c =================================================================== RCS file: /cvs/src/src/gdb/remote-fileio.c,v retrieving revision 1.12 diff -c -5 -p -r1.12 remote-fileio.c *** remote-fileio.c 14 Feb 2005 18:10:10 -0000 1.12 --- remote-fileio.c 9 Mar 2005 19:15:32 -0000 *************** remote_fileio_mode_to_host (long mode, i *** 160,181 **** --- 160,191 ---- hmode |= S_IRUSR; if (mode & FILEIO_S_IWUSR) hmode |= S_IWUSR; if (mode & FILEIO_S_IXUSR) hmode |= S_IXUSR; + #ifdef S_IRGRP if (mode & FILEIO_S_IRGRP) hmode |= S_IRGRP; + #endif + #ifdef S_IWGRP if (mode & FILEIO_S_IWGRP) hmode |= S_IWGRP; + #endif + #ifdef S_IXGRP if (mode & FILEIO_S_IXGRP) hmode |= S_IXGRP; + #endif if (mode & FILEIO_S_IROTH) hmode |= S_IROTH; + #ifdef S_IWOTH if (mode & FILEIO_S_IWOTH) hmode |= S_IWOTH; + #endif + #ifdef S_IXOTH if (mode & FILEIO_S_IXOTH) hmode |= S_IXOTH; + #endif return hmode; } static LONGEST remote_fileio_mode_to_target (mode_t mode) *************** remote_fileio_mode_to_target (mode_t mod *** 192,213 **** --- 202,233 ---- tmode |= FILEIO_S_IRUSR; if (mode & S_IWUSR) tmode |= FILEIO_S_IWUSR; if (mode & S_IXUSR) tmode |= FILEIO_S_IXUSR; + #ifdef S_IRGRP if (mode & S_IRGRP) tmode |= FILEIO_S_IRGRP; + #endif + #ifdef S_IWRGRP if (mode & S_IWGRP) tmode |= FILEIO_S_IWGRP; + #endif + #ifdef S_IXGRP if (mode & S_IXGRP) tmode |= FILEIO_S_IXGRP; + #endif if (mode & S_IROTH) tmode |= FILEIO_S_IROTH; + #ifdef S_IWOTH if (mode & S_IWOTH) tmode |= FILEIO_S_IWOTH; + #endif + #ifdef S_IXOTH if (mode & S_IXOTH) tmode |= FILEIO_S_IXOTH; + #endif return tmode; } static int remote_fileio_errno_to_target (int error)