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

Commit2b61b3e

Browse files
committed
Assorted fixes to make pg_upgrade build on MSVC.
* There is no chmod() on Windows.* Must always use the 3-parameter version of open()* There is no dynloader.h - but it also appears unnecessary on all platforms* Don't include shlobj.h because it causes compile errors, and from what I can see it's not actually used. This may need to be added back for mingw and/or cygwin in the worst case.
1 parentf1ac08d commit2b61b3e

File tree

4 files changed

+3
-5
lines changed

4 files changed

+3
-5
lines changed

‎contrib/pg_upgrade/check.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,9 +427,11 @@ create_script_for_old_cluster_deletion(migratorContext *ctx,
427427

428428
fclose(script);
429429

430+
#ifndefWIN32
430431
if (chmod(*deletion_script_file_name,S_IRWXU)!=0)
431432
pg_log(ctx,PG_FATAL,"Could not add execute permission to file: %s\n",
432433
*deletion_script_file_name);
434+
#endif
433435

434436
check_ok(ctx);
435437
}

‎contrib/pg_upgrade/exec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ is_server_running(migratorContext *ctx, const char *datadir)
122122

123123
snprintf(path,sizeof(path),"%s/postmaster.pid",datadir);
124124

125-
if ((fd=open(path,O_RDONLY))<0)
125+
if ((fd=open(path,O_RDONLY,0))<0)
126126
{
127127
if (errno!=ENOENT)
128128
pg_log(ctx,PG_FATAL,"\ncould not open file \"%s\" for reading\n",

‎contrib/pg_upgrade/page.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
#include"pg_upgrade.h"
88

9-
#include"dynloader.h"
109
#include"storage/bufpage.h"
1110

1211

‎contrib/pg_upgrade/pg_upgrade.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
#include<sys/stat.h>
1313
#include<sys/time.h>
1414
#include<sys/types.h>
15-
#ifdefWIN32
16-
#include<shlobj.h>
17-
#endif
1815

1916
#include"libpq-fe.h"
2017

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp