Re: pg_read_file() with virtual files returns empty string - Mailing list pgsql-hackers

From Joe Conway
Subject Re: pg_read_file() with virtual files returns empty string
Date
Msg-id e47a8413-2e97-586a-21af-8592eeeda713@joeconway.com
Whole thread Raw
In response to Re: pg_read_file() with virtual files returns empty string  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pg_read_file() with virtual files returns empty string
List pgsql-hackers
On 7/4/20 12:52 PM, Tom Lane wrote:
> Justin Pryzby <pryzby@telsasoft.com> writes:
>> But I noticed that cfbot is now populating with failures like:
>
>> genfile.c: In function ‘read_binary_file’:
>> genfile.c:192:5: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result
[-Werror=unused-result]
>>      fread(rbuf, 1, 1, file);
>>      ^
>
> Yeah, some of the pickier buildfarm members (eg spurfowl) are showing
> that as a warning, too.  Maybe make it like
>
>                 if (fread(rbuf, 1, 1, file) != 0 || !feof(file))
>                     ereport(ERROR,
>
> Probably the feof test is redundant this way, but I'd be inclined to
> leave it in anyhow.

Ok, will fix. Thanks for the heads up.

Joe

--
Crunchy Data - http://crunchydata.com
PostgreSQL Support for Secure Enterprises
Consulting, Training, & Open Source Development


Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_read_file() with virtual files returns empty string
Next
From: Joe Conway
Date:
Subject: Re: pg_read_file() with virtual files returns empty string