pgsql: Fix pg_truncate() on Windows. - Mailing list pgsql-committers

From Thomas Munro
Subject pgsql: Fix pg_truncate() on Windows.
Date
Msg-id E1pDe0G-002GTj-8w@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix pg_truncate() on Windows.

Commit 57faaf376 added pg_truncate(const char *path, off_t length), but
"length" was ignored under WIN32 and the file was unconditionally
truncated to 0.

There was no live bug, since the only caller passes 0.

Fix, and back-patch to 14 where the function arrived.

Author: Justin Pryzby <pryzby@telsasoft.com>
Discussion: https://postgr.es/m/20230106031652.GR3109%40telsasoft.com

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f60acde869985b35146c6f7f941dd571fc88b3c4

Modified Files
--------------
src/backend/storage/file/fd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)


pgsql-committers by date:

Previous
From: Thomas Munro
Date:
Subject: pgsql: Fix pg_truncate() on Windows.
Next
From: Thomas Munro
Date:
Subject: pgsql: Fix pg_truncate() on Windows.