File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -492,7 +492,7 @@ catalog_read_ini(const char *path)
492
492
493
493
if (backup_mode )
494
494
{
495
- backup -> backup_mode = parse_backup_mode (backup_mode , WARNING );
495
+ backup -> backup_mode = parse_backup_mode (backup_mode );
496
496
free (backup_mode );
497
497
}
498
498
@@ -545,12 +545,14 @@ catalog_read_ini(const char *path)
545
545
}
546
546
547
547
BackupMode
548
- parse_backup_mode (const char * value , int elevel )
548
+ parse_backup_mode (const char * value )
549
549
{
550
550
const char * v = value ;
551
551
size_t len ;
552
552
553
- while (IsSpace (* v )) { v ++ ; }
553
+ /* Skip all spaces detected */
554
+ while (IsSpace (* v ))
555
+ v ++ ;
554
556
len = strlen (v );
555
557
556
558
if (len > 0 && pg_strncasecmp ("full" , v , len ) == 0 )
@@ -560,7 +562,8 @@ parse_backup_mode(const char *value, int elevel)
560
562
else if (len > 0 && pg_strncasecmp ("archive" , v , len ) == 0 )
561
563
return BACKUP_MODE_ARCHIVE ;
562
564
563
- elog (elevel , _ ("invalid backup-mode \"%s\"" ), value );
565
+ /* Backup mode is invalid, so leave with an error */
566
+ elog (ERROR_ARGS , _ ("invalid backup-mode \"%s\"" ), value );
564
567
return BACKUP_MODE_INVALID ;
565
568
}
566
569
Original file line number Diff line number Diff line change @@ -330,5 +330,5 @@ if(!IsValidTime(tm)){
330
330
static void
331
331
opt_backup_mode (pgut_option * opt , const char * arg )
332
332
{
333
- current .backup_mode = parse_backup_mode (arg , ERROR_ARGS );
333
+ current .backup_mode = parse_backup_mode (arg );
334
334
}
Original file line number Diff line number Diff line change @@ -230,7 +230,7 @@ extern const char *pgdata_exclude[];
230
230
231
231
/* in backup.c */
232
232
extern int do_backup (pgBackupOption bkupopt );
233
- extern BackupMode parse_backup_mode (const char * value , int elevel );
233
+ extern BackupMode parse_backup_mode (const char * value );
234
234
extern void check_server_version (void );
235
235
extern bool fileExists (const char * path );
236
236
You can’t perform that action at this time.
0 commit comments