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: Fix BZ #18757 (fmemopen doesn't fail with invalid modes)


On 09 Aug 2015 22:00, Paul Pluzhnikov wrote:
> -  return _IO_fopencookie (c, mode, iof);
> +  ret = _IO_fopencookie (c, mode, iof);
> +
> +  if (__glibc_unlikely (ret == NULL))
> +    {
> +      /* BZ #18757 -- set EINVAL.  */
> +      __set_errno (EINVAL);

i'm not sure normalizing all errors into EINVAL is correct.  you might get back
NULL if malloc failed in which case it'd be ENOMEM.  i think we want to plumb
errno setting down further where the actual errors are flagged and leave this
func alone.
-mike

Attachment: signature.asc
Description: Digital signature


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