From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19137 invoked by alias); 14 Jun 2008 11:09:29 -0000 Received: (qmail 19129 invoked by uid 22791); 14 Jun 2008 11:09:29 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 14 Jun 2008 11:09:12 +0000 Received: (qmail 5741 invoked from network); 14 Jun 2008 11:09:10 -0000 Received: from unknown (HELO localhost) (vladimir@127.0.0.2) by mail.codesourcery.com with ESMTPA; 14 Jun 2008 11:09:10 -0000 From: Vladimir Prus To: "Pierre Muller" Subject: Re: Better realpath Date: Sat, 14 Jun 2008 12:14:00 -0000 User-Agent: KMail/1.9.9 Cc: gdb-patches@sources.redhat.com References: <200806141024.41812.vladimir@codesourcery.com> <000001c8ce09$d121f430$7365dc90$@u-strasbg.fr> In-Reply-To: <000001c8ce09$d121f430$7365dc90$@u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200806141509.28797.vladimir@codesourcery.com> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-06/txt/msg00259.txt.bz2 On Saturday 14 June 2008 14:31:32 Pierre Muller wrote: > I just looked at your patch and the idea seems > good... But I am no expert on this field. > > One question though, libiberty lrealpath > function uses strdup, while the replaced > code uses xstrdup. > xstrdup is also defined in libiberty > as being a replacement of strdup that never > fails... (didn't really get how this is > possible...) > > Anyhow, is this a potential issue? I don't think so. xstrdup is supposed to fail if it cannot get enough memory. lrealpath, as it is now, will return NULL, but with my patch, there's a check for that in gdb_realpath -- and a call to nomem. (And no, I did not think about that myself -- Dan suggested the check and the call to nomem). - Volodya