This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: ldconfig speedup


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"));


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]