@@ -101,9 +101,6 @@ parseCommandLine(int argc, char *argv[])
101
101
if (os_user_effective_id == 0 )
102
102
pg_fatal ("%s: cannot be run as root\n" , os_info .progname );
103
103
104
- if ((log_opts .internal = fopen_priv (INTERNAL_LOG_FILE , "a" )) == NULL )
105
- pg_fatal ("could not write to log file \"%s\"\n" , INTERNAL_LOG_FILE );
106
-
107
104
while ((option = getopt_long (argc , argv , "d:D:b:B:cj:ko:O:p:P:rs:U:v" ,
108
105
long_options , & optindex )) != -1 )
109
106
{
@@ -205,7 +202,6 @@ parseCommandLine(int argc, char *argv[])
205
202
break ;
206
203
207
204
case 'v' :
208
- pg_log (PG_REPORT , "Running in verbose mode\n" );
209
205
log_opts .verbose = true;
210
206
break ;
211
207
@@ -214,12 +210,18 @@ parseCommandLine(int argc, char *argv[])
214
210
break ;
215
211
216
212
default :
217
- pg_fatal ( "Try \"%s --help\" for more information.\n" ,
218
- os_info .progname );
219
- break ;
213
+ fprintf ( stderr , _ ( "Try \"%s --help\" for more information.\n" ) ,
214
+ os_info .progname );
215
+ exit ( 1 ) ;
220
216
}
221
217
}
222
218
219
+ if ((log_opts .internal = fopen_priv (INTERNAL_LOG_FILE , "a" )) == NULL )
220
+ pg_fatal ("could not write to log file \"%s\"\n" , INTERNAL_LOG_FILE );
221
+
222
+ if (log_opts .verbose )
223
+ pg_log (PG_REPORT , "Running in verbose mode\n" );
224
+
223
225
/* label start of upgrade in logfiles */
224
226
for (filename = output_files ; * filename != NULL ; filename ++ )
225
227
{
0 commit comments