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:

> I've fixed a few comments and whitespace problems and have appended the
> current version for review again.
>
> Ok to commit?
> Andreas
...
> +  /* Create file.  */
> +  fd = open (temp_name, O_CREAT|O_WRONLY|O_TRUNC|O_NOFOLLOW,
> +	     S_IROTH|S_IRGRP|S_IRUSR|S_IWUSR);
> +  if (fd < 0)
> +    error (EXIT_FAILURE, errno,
> +	   _("Can't create temporary auxiliary cache file %s"),
> +	   temp_name);
> +
> +  if (write (fd, aux_file_entries, aux_file_entries_size)
> +	  != (ssize_t) aux_file_entries_size)
> +	error (EXIT_FAILURE, errno,
> +	       _("Writing of auxiliary cache data failed"));
> +
> +  if (write (fd, strings, total_strlen) != (ssize_t) total_strlen)
> +    error (EXIT_FAILURE, errno, _("Writing of auxiliary cache data failed"));
> +
> +  close (fd);

Hi Andreas,

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?

Jim


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