[PATCH] elf_begin sets elf_errno for cases that the file is completely unreadable

Petr Machata pmachata at redhat.com
Thu Sep 11 18:49:01 UTC 2014


Roland McGrath <roland at hack.frob.com> writes:

>>    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.

Pushed with that fix.

Thanks,
PM


More information about the elfutils-devel mailing list