We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a030bfa commit c9f48b5Copy full SHA for c9f48b5
contrib/pg_upgrade/option.c
@@ -56,6 +56,7 @@ parseCommandLine(int argc, char *argv[])
56
int option; /* Command line option */
57
int optindex = 0; /* used by getopt_long */
58
int os_user_effective_id;
59
+ char *return_buf;
60
61
user_opts.transfer_mode = TRANSFER_MODE_COPY;
62
@@ -93,7 +94,9 @@ parseCommandLine(int argc, char *argv[])
93
94
if (os_user_effective_id == 0)
95
pg_log(PG_FATAL, "%s: cannot be run as root\n", os_info.progname);
96
- getcwd(os_info.cwd, MAXPGPATH);
97
+ return_buf = getcwd(os_info.cwd, MAXPGPATH);
98
+ if (return_buf == NULL)
99
+ pg_log(PG_FATAL, "Could not access current working directory: %s\n", getErrorText(errno));
100
101
while ((option = getopt_long(argc, argv, "d:D:b:B:cgG:kl:o:O:p:P:u:v",
102
long_options, &optindex)) != -1)
0 commit comments