From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============2946317186196023335==" MIME-Version: 1.0 From: Roland McGrath 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 Message-ID: <20140910203656.D09BA2C39CA@topped-with-meat.com> In-Reply-To: 25b4c5f3c6b5c513f6c8b2c9da199f9cd02e6be8.1410380644.git.pmachata@redhat.com --===============2946317186196023335== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable > if (unlikely (nread =3D=3D -1)) > - /* We cannot even read the head of the file. Maybe FILDES is associ= ated > - 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 asso= ciated > + 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. --===============2946317186196023335==--