RFC: ldconfig speedup
Jim Meyering
jim@meyering.net
Wed Jul 4 10:05:00 GMT 2007
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"));
More information about the Libc-alpha
mailing list