From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21160 invoked by alias); 15 Dec 2004 13:41:35 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 20901 invoked from network); 15 Dec 2004 13:41:24 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 15 Dec 2004 13:41:24 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id iBFDfEad011658 for ; Wed, 15 Dec 2004 08:41:19 -0500 Received: from post-office.corp.redhat.com (post-office.corp.redhat.com [172.16.52.227]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id iBFDfEr27460; Wed, 15 Dec 2004 08:41:14 -0500 Received: from greed.delorie.com (dj.cipe.redhat.com [10.0.0.222]) by post-office.corp.redhat.com (8.11.6/8.11.6) with ESMTP id iBFDfD831971; Wed, 15 Dec 2004 08:41:13 -0500 Received: from greed.delorie.com (localhost [127.0.0.1]) by greed.delorie.com (8.12.11/8.12.10) with ESMTP id iBFDfB1I016125; Wed, 15 Dec 2004 08:41:12 -0500 Received: (from dj@localhost) by greed.delorie.com (8.12.11/8.12.11/Submit) id iBFDfB5C016121; Wed, 15 Dec 2004 08:41:11 -0500 Date: Wed, 15 Dec 2004 13:41:00 -0000 Message-Id: <200412151341.iBFDfB5C016121@greed.delorie.com> From: DJ Delorie To: JBeulich@novell.com CC: ian@wasabisystems.com, binutils@sources.redhat.com In-reply-to: (JBeulich@novell.com) Subject: Re: [PATCH] Re: deletion of output files References: X-SW-Source: 2004-12/txt/msg00161.txt.bz2 > tmpnam.c \ > vasprintf.c vfork.c vfprintf.c vprintf.c vsnprintf.c > vsprintf.c \ > + unlink-if-ordinary.c \ This list is supposed to be in alphabetical order. Also, your mailer is corrupting your patch by line wrapping. (yes, I saw the attached binary, just FYI). > @@ -973,6 +975,13 @@ $(CONFIGURED_OFILES): stamp-picdir > else true; fi > $(COMPILE.c) $(srcdir)/tmpnam.c $(OUTPUT_OPTION) > > +./unlink-if-ordinary.o: $(srcdir)/unlink-if-ordinary.c config.h > $(INCDIR)/ansidecl.h \ > + $(INCDIR)/libiberty.h > + if [ x"$(PICFLAG)" != x ]; then \ > + $(COMPILE.c) $(PICFLAG) $(srcdir)/unlink-if-ordinary.c -o > pic/$@; \ > + else true; fi > + $(COMPILE.c) $(srcdir)/unlink-if-ordinary.c $(OUTPUT_OPTION) > + Did you use "make maint-deps" to produce this part, or cut and paste? > /home/jbeulich/src/binutils/mainline/2004-12-03.13.35/libiberty/unlink-if-ordinary.c 1970-01-01 > 01:00:00.000000000 +0100 > +++ 2004-12-03.13.35/libiberty/unlink-if-ordinary.c 2004-12-15 > 12:14:37.960124016 +0100 > @@ -0,0 +1,49 @@ > +/* unlink-if-ordinary.c - remove link to a file unless it is special > */ Copyright block required. > +/* > + > +@deftypefn Supplemental int unlink_if_ordinary (const char*) > + > +Unlink the named file, unless it is special (e.g. a device file). > +Returns 0 when the file was unlinked, a negative value (and errno set) > when > +there was an error deleting the file, and a positive value if no > attempt > +was made to unlink the file because it is special. Hmmm... I wonder if returning an error condition when it doesn't attempt an unlink is accurate. After all, it correctly did what it was supposed to do. Any bets on how often programmers forget to check for this? ;-) > + return unlink (name); > + > + return 1; > +} I wonder if we should set errno to something useful if we return 1. Else, we should document that errno is unspecified in that case.