This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: RFC: ldconfig speedup
- From: Jim Meyering <jim at meyering dot net>
- To: Andreas Jaeger <aj at suse dot de>
- Cc: "GNU C. Library" <libc-alpha at sources dot redhat dot com>, Michael Schroeder <mls at suse dot de>
- Date: Wed, 04 Jul 2007 12:05:06 +0200
- Subject: Re: RFC: ldconfig speedup
- References: <20070627190237.3CF8A4D05E6@magilla.localdomain> <m3y7i5yzjk.fsf@gromit.moeb> <876455cgf1.fsf@mid.deneb.enyo.de> <hoejjrs1fx.fsf@reger.suse.de> <87r6npdd12.fsf@rho.meyering.net> <m3wsxhpa1i.fsf@gromit.moeb>
Andreas Jaeger <aj@suse.de> wrote:
> Jim Meyering <jim@meyering.net> writes:
>> You checked most other syscall return values (including the writes to "fd"),
>> but don't you want to check for close failure on this just-written
>> file descriptor?
>
> This is a long standing omission in ldconfig and other places in glibc.
> What kind of action would you propose here - remove the file? If this
> is desirable, let's do it in a separate patch...
Just diagnose it and exit nonzero, treating close failure
like any other write error.
I.e., instead of this:
+ if (write (fd, strings, total_strlen) != (ssize_t) total_strlen)
+ error (EXIT_FAILURE, errno, _("Writing of auxiliary cache data failed"));
+
+ close (fd);
do this:
if (write (fd, strings, total_strlen) != (ssize_t) total_strlen
|| close (fd) != 0)
error (EXIT_FAILURE, errno, _("Writing of auxiliary cache data failed"));