Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch/rfc/testsuite] Fix read-only fileio test on GNU/Linux
@ 2004-01-05 20:01 Andrew Cagney
  2004-01-07 16:04 ` Andrew Cagney
  2004-01-26 11:46 ` Corinna Vinschen
  0 siblings, 2 replies; 3+ messages in thread
From: Andrew Cagney @ 2004-01-05 20:01 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 362 bytes --]

Hello,

I think this deserves a "how did this ever work" award :-)

The file was being created writeable (the S_IWUSR flag passed to open()) 
so little wonder GNU/Linux allowed an open-write (causing the test to 
fail) and who knows how/who this worked on BSD and remote systems.

Tested on BSD and GNU/Linux.  Baring comment I'll commit in a day or so.

Andrew

[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 760 bytes --]

2004-01-05  Andrew Cagney  <cagney@redhat.com>

	* gdb.base/fileio.c (test_open): Do not pass S_IWUSR to "open"
	when creating the read-only file.  From analysis by Roland McGrath
	and Elena Zannoni.

Index: gdb.base/fileio.c
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/fileio.c,v
retrieving revision 1.4
diff -u -r1.4 fileio.c
--- gdb.base/fileio.c	2 Jan 2004 22:53:12 -0000	1.4
+++ gdb.base/fileio.c	5 Jan 2004 19:52:39 -0000
@@ -103,7 +103,7 @@
     close (ret);
   /* Open for write but no write permission */
   errno = 0;
-  ret = open (NOWRITE, O_CREAT | O_RDONLY, S_IRUSR | S_IWUSR);
+  ret = open (NOWRITE, O_CREAT | O_RDONLY, S_IRUSR);
   if (ret >= 0)
     {
       close (ret);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch/rfc/testsuite] Fix read-only fileio test on GNU/Linux
  2004-01-05 20:01 [patch/rfc/testsuite] Fix read-only fileio test on GNU/Linux Andrew Cagney
@ 2004-01-07 16:04 ` Andrew Cagney
  2004-01-26 11:46 ` Corinna Vinschen
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Cagney @ 2004-01-07 16:04 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches

> Hello,
> 
> I think this deserves a "how did this ever work" award :-)
> 
> The file was being created writeable (the S_IWUSR flag passed to open()) so little wonder GNU/Linux allowed an open-write (causing the test to fail) and who knows how/who this worked on BSD and remote systems.
> 
> Tested on BSD and GNU/Linux.  Baring comment I'll commit in a day or so.

Committed.  This leaves just:

FAIL: gdb.base/fileio.exp: Renaming a directory to a non-empty directory 
returns ENOTEMPTY or EEXIST

I'll follow that up shortly.

Andrew



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch/rfc/testsuite] Fix read-only fileio test on GNU/Linux
  2004-01-05 20:01 [patch/rfc/testsuite] Fix read-only fileio test on GNU/Linux Andrew Cagney
  2004-01-07 16:04 ` Andrew Cagney
@ 2004-01-26 11:46 ` Corinna Vinschen
  1 sibling, 0 replies; 3+ messages in thread
From: Corinna Vinschen @ 2004-01-26 11:46 UTC (permalink / raw)
  To: gdb-patches

On Jan  5 15:01, Andrew Cagney wrote:
> Hello,
> 
> I think this deserves a "how did this ever work" award :-)
> 
> The file was being created writeable (the S_IWUSR flag passed to open()) 
> so little wonder GNU/Linux allowed an open-write (causing the test to 
> fail) and who knows how/who this worked on BSD and remote systems.
> 
> Tested on BSD and GNU/Linux.  Baring comment I'll commit in a day or so.

It's late but nevertheless, thanks.  I compared with my original sources
from end of 2002 in which I used just S_IRUSR.  I'm still wondering why 
and when I added S_IWUSR before submitting this patch to FSF.  Oh boy...

Corinna

-- 
Corinna Vinschen
Cygwin Developer
Red Hat, Inc.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-01-26 11:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-05 20:01 [patch/rfc/testsuite] Fix read-only fileio test on GNU/Linux Andrew Cagney
2004-01-07 16:04 ` Andrew Cagney
2004-01-26 11:46 ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox