Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit414dd89

Browse files
macdicepull[bot]
authored andcommitted
Fix pg_truncate() on Windows.
Commit57faaf3 added pg_truncate(const char *path, off_t length), but"length" was ignored under WIN32 and the file was unconditionallytruncated 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
1 parent6652879 commit414dd89

File tree

1 file changed

+1
-1
lines changed
  • src/backend/storage/file

1 file changed

+1
-1
lines changed

‎src/backend/storage/file/fd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ pg_truncate(const char *path, off_t length)
638638
fd=OpenTransientFile(path,O_RDWR |PG_BINARY);
639639
if (fd >=0)
640640
{
641-
ret=ftruncate(fd,0);
641+
ret=ftruncate(fd,length);
642642
save_errno=errno;
643643
CloseTransientFile(fd);
644644
errno=save_errno;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp