public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Ian Lance Taylor <iant@google.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] drop MAXPATHLEN dependency from gcc/tlink.c
Date: Wed, 01 Aug 2007 21:03:00 -0000	[thread overview]
Message-ID: <20070801210310.GC3667@interface.famille.thibault.fr> (raw)
In-Reply-To: <m38x8wm3u7.fsf@localhost.localdomain>

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

Ian Lance Taylor, le Tue 31 Jul 2007 18:38:24 -0700, a écrit :
> Samuel Thibault <samuel.thibault@ens-lyon.org> writes:
> > Some systems don't define MAXPATHLEN because they don't have such hard
> > limit.  Here is a patch against gcc/tlink.c to take benefit of this.
> > 
> > 	(tlink_init): Add loop to dynamically allocate initial_cwd as needed.
> 
> Just call getpwd instead.

Oh right, I didn't notice that non-standard function.  Here is an
updated patch

Samuel

[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 903 bytes --]

2007-08-01  Samuel Thibault  <samuel.thibault@ens-lyon.org>

      * gcc/tlink.c: Include "libiberty.h"
      (initial_cwd): Change type into char*.
      (tlink_init): Call getpwd() instead of getcwd().

Index: gcc/tlink.c
===================================================================
--- gcc/tlink.c	(r�vision 127116)
+++ gcc/tlink.c	(copie de travail)
@@ -30,6 +30,7 @@
 #include "hashtab.h"
 #include "demangle.h"
 #include "collect2.h"
+#include "libiberty.h"
 
 #define MAX_ITERATIONS 17
 
@@ -38,7 +39,7 @@
 
 static int tlink_verbose;
 
-static char initial_cwd[MAXPATHLEN + 1];
+static char *initial_cwd;
 \f
 /* Hash table boilerplate for working with htab_t.  We have hash tables
    for symbol names, file names, and demangled symbols.  */
@@ -274,7 +275,7 @@
 	tlink_verbose = 3;
     }
 
-  getcwd (initial_cwd, sizeof (initial_cwd));
+  initial_cwd = getpwd();
 }
 
 static int

  reply	other threads:[~2007-08-01 21:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-24 21:19 Samuel Thibault
2007-08-01  1:39 ` Ian Lance Taylor
2007-08-01 21:03   ` Samuel Thibault [this message]
2007-08-04 21:20     ` Samuel Thibault
2007-08-08 14:01     ` Ian Lance Taylor
2007-08-08 14:13       ` Samuel Thibault
2007-08-08 14:25         ` Ian Lance Taylor
2007-08-13 20:57           ` Samuel Thibault

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=20070801210310.GC3667@interface.famille.thibault.fr \
    --to=samuel.thibault@ens-lyon.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=iant@google.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).