Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mark Mitchell <mark@codesourcery.com>
To: gdb-patches@sources.redhat.com
Subject: PATCH: Avoid using S_IRGRP, etc., on Windows
Date: Wed, 09 Mar 2005 19:20:00 -0000	[thread overview]
Message-ID: <200503091920.j29JKRRM007735@sethra.codesourcery.com> (raw)


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  <mark@codesourcery.com>

	* 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)


             reply	other threads:[~2005-03-09 19:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-09 19:20 Mark Mitchell [this message]
2005-03-16 15:30 ` Daniel Jacobowitz
2005-03-16 16:38   ` Mark Mitchell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200503091920.j29JKRRM007735@sethra.codesourcery.com \
    --to=mark@codesourcery.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox