public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Roland McGrath <roland@hack.frob.com>
To: elfutils-devel@lists.fedorahosted.org
Subject: Re: [PATCH] elf_begin sets elf_errno for cases that the file is completely unreadable
Date: Wed, 10 Sep 2014 13:36:56 -0700	[thread overview]
Message-ID: <20140910203656.D09BA2C39CA@topped-with-meat.com> (raw)
In-Reply-To: 25b4c5f3c6b5c513f6c8b2c9da199f9cd02e6be8.1410380644.git.pmachata@redhat.com

[-- Attachment #1: Type: text/plain, Size: 532 bytes --]

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

             reply	other threads:[~2014-09-10 20:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-10 20:36 Roland McGrath [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-09-11 18:49 Petr Machata
2014-09-10 20:25 Petr Machata

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140910203656.D09BA2C39CA@topped-with-meat.com \
    --to=roland@hack.frob.com \
    --cc=elfutils-devel@lists.fedorahosted.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).