public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Douglas B Rupp <rupp@gnat.com>
To: DJ Delorie <dj@redhat.com>
Cc: ian@airs.com, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Libiberty for VMS - mkstemps.c don't mix case
Date: Mon, 28 Jun 2010 00:55:00 -0000	[thread overview]
Message-ID: <4C27D114.5010405@gnat.com> (raw)
In-Reply-To: <4C27902E.7030300@gnat.com>

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

Douglas B Rupp wrote:
> What is your thinking?
> 

For the sake of discussion, this is the patch.




[-- Attachment #2: wb.dif.txt --]
[-- Type: text/plain, Size: 1885 bytes --]

diff -rupN gcc-head-src.orig/gcc/gcc.c gcc-head-src/gcc/gcc.c
--- gcc-head-src.orig/gcc/gcc.c	2010-06-24 17:26:24.000000000 -0700
+++ gcc-head-src/gcc/gcc.c	2010-06-27 15:22:34.000000000 -0700
@@ -5386,7 +5386,27 @@ do_spec_1 (const char *spec, int inswitc
 			saved_suffix = NULL;
 		      }
 		    else
-		      t->suffix = save_string (suffix, suffix_length);
+		      {
+#ifdef VMS
+			/* Force an explicit version number on VMS.  */
+			char *vmssuffix = alloca (suffix_length + 4);
+
+			strncpy (vmssuffix, suffix, suffix_length);
+			if (suffix_length > 0)
+			  {
+			    strncpy (vmssuffix + suffix_length, ".1", 3);
+			    suffix_length += 2;
+			  }
+			else
+			  {
+			    strncpy (vmssuffix + suffix_length, "..1", 4);
+			    suffix_length += 3;
+			  }
+			suffix = vmssuffix;
+#endif
+			t->suffix = save_string (suffix, suffix_length);
+		      }
+
 		    t->unique = (c == 'u' || c == 'U' || c == 'j');
 		    temp_filename = make_temp_file (t->suffix);
 		    temp_filename_length = strlen (temp_filename);
diff -rupN gcc-head-src.orig/gcc/toplev.c gcc-head-src/gcc/toplev.c
--- gcc-head-src.orig/gcc/toplev.c	2010-06-20 14:02:46.000000000 -0700
+++ gcc-head-src/gcc/toplev.c	2010-06-27 15:23:41.000000000 -0700
@@ -1382,9 +1382,22 @@ init_asm_output (const char *name)
       if (!strcmp (asm_file_name, "-"))
 	asm_out_file = stdout;
       else
-	asm_out_file = fopen (asm_file_name, "w+b");
+	asm_out_file = fopen (asm_file_name, "a+b");
       if (asm_out_file == 0)
 	fatal_error ("can%'t open %s for writing: %m", asm_file_name);
+
+      if (asm_out_file != stdout)
+	{
+	  int fd, ierr;
+
+	  fd = fileno (asm_out_file);
+	  if (fd < 0)
+	    fatal_error ("can%'t get fileno for %s: %m", asm_file_name);
+
+	  ierr = ftruncate (fd, 0);
+	  if (ierr < 0)
+	    fatal_error ("can%'t truncate %s: %m", asm_file_name);
+	}
     }
 
   if (!flag_syntax_only)

  reply	other threads:[~2010-06-27 22:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-23  0:54 Douglas B Rupp
2009-07-23  1:05 ` DJ Delorie
2009-07-23  1:11   ` Douglas B Rupp
2009-07-23  1:24     ` DJ Delorie
2009-07-23  1:41       ` Douglas B Rupp
2009-07-23  2:24         ` DJ Delorie
2009-07-23  3:38           ` Douglas B Rupp
2010-06-27 19:24           ` Douglas B Rupp
2010-06-28  0:55             ` Douglas B Rupp [this message]
2010-06-28 20:27             ` DJ Delorie
2010-06-28 21:19               ` Douglas B Rupp
2010-06-28 22:21                 ` DJ Delorie
2009-07-23  2:50         ` Douglas B Rupp

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=4C27D114.5010405@gnat.com \
    --to=rupp@gnat.com \
    --cc=dj@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=ian@airs.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).