* PATCH: Avoid using S_IRGRP, etc., on Windows
@ 2005-03-09 19:20 Mark Mitchell
2005-03-16 15:30 ` Daniel Jacobowitz
0 siblings, 1 reply; 3+ messages in thread
From: Mark Mitchell @ 2005-03-09 19:20 UTC (permalink / raw)
To: gdb-patches
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)
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: PATCH: Avoid using S_IRGRP, etc., on Windows
2005-03-09 19:20 PATCH: Avoid using S_IRGRP, etc., on Windows Mark Mitchell
@ 2005-03-16 15:30 ` Daniel Jacobowitz
2005-03-16 16:38 ` Mark Mitchell
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2005-03-16 15:30 UTC (permalink / raw)
To: Mark Mitchell; +Cc: gdb-patches
On Wed, Mar 09, 2005 at 11:20:27AM -0800, Mark Mitchell wrote:
>
> 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.
Yeah, this is OK.
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: PATCH: Avoid using S_IRGRP, etc., on Windows
2005-03-16 15:30 ` Daniel Jacobowitz
@ 2005-03-16 16:38 ` Mark Mitchell
0 siblings, 0 replies; 3+ messages in thread
From: Mark Mitchell @ 2005-03-16 16:38 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb-patches
Daniel Jacobowitz wrote:
> On Wed, Mar 09, 2005 at 11:20:27AM -0800, Mark Mitchell wrote:
>
>>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?
>
> Yeah, this is OK.
Applied, thanks!
--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-03-16 16:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-09 19:20 PATCH: Avoid using S_IRGRP, etc., on Windows Mark Mitchell
2005-03-16 15:30 ` Daniel Jacobowitz
2005-03-16 16:38 ` Mark Mitchell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox