Re: Fix fseek() detection of unseekable files on WIN32 - Mailing list pgsql-hackers

From Juan José Santamaría Flecha
Subject Re: Fix fseek() detection of unseekable files on WIN32
Date
Msg-id CAC+AXB0042dK+xWTZqsmm47fB+tRcCOp-M37R31+Budv-gqefA@mail.gmail.com
Whole thread Raw
In response to Re: Fix fseek() detection of unseekable files on WIN32  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Fix fseek() detection of unseekable files on WIN32
List pgsql-hackers

On Sun, Mar 19, 2023 at 12:45 PM Michael Paquier <michael@paquier.xyz> wrote:

In short, I was thinking among the lines of something like the
attached, where I have invented a pgwin32_get_file_type() that acts as
a wrapper of GetFileType() in a new file called win32common.c, with
all the error handling we would use between fstat(), fseeko() and
ftello() centralized in a single code path.

The refactoring with win32common.c had better be separated into its
own patch, at the end, if using an approach like that.

My approach was trying to make something minimal so it could be backpatchable. This looks fine for HEAD, but are you planning on something similar for the other branches?

Doesn't pgwin32_get_file_type() fit in dirmod.c? Might be a question of personal taste, I don't really have strong feelings against win32common.c.

Regards,

Juan José Santamaría Flecha


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Extending outfuncs support to utility statements
Next
From: Justin Pryzby
Date:
Subject: Re: Memory leak from ExecutorState context?