File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ parseCommandLine(int argc, char *argv[])
56
56
int option ; /* Command line option */
57
57
int optindex = 0 ; /* used by getopt_long */
58
58
int os_user_effective_id ;
59
+ char * return_buf ;
59
60
60
61
user_opts .transfer_mode = TRANSFER_MODE_COPY ;
61
62
@@ -93,7 +94,9 @@ parseCommandLine(int argc, char *argv[])
93
94
if (os_user_effective_id == 0 )
94
95
pg_log (PG_FATAL , "%s: cannot be run as root\n" , os_info .progname );
95
96
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 ));
97
100
98
101
while ((option = getopt_long (argc , argv , "d:D:b:B:cgG:kl:o:O:p:P:u:v" ,
99
102
long_options , & optindex )) != -1 )
You can’t perform that action at this time.
0 commit comments