This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: [PATCH] elf_begin sets elf_errno for cases that the file is completely unreadable
- From: Roland McGrath <roland at hack dot frob dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Wed, 10 Sep 2014 13:36:56 -0700
- Subject: Re: [PATCH] elf_begin sets elf_errno for cases that the file is completely unreadable
> if (unlikely (nread == -1))
> - /* We cannot even read the head of the file. Maybe FILDES is associated
> - with an unseekable device. This is nothing we can handle. */
> - return NULL;
> + {
> + __libelf_seterrno (ELF_E_INVALID_FILE);
> + /* We cannot even read the head of the file. Maybe FILDES is associated
> + with an unseekable device. This is nothing we can handle. */
> + return NULL;
> + }
That looks sensible, though I'd keep the comment at the top of the block.