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

Commite163c45

Browse files
committed
Rename dubious pg_probackup variable into PROGRAM_NAME_FULL
1 parent66ad282 commite163c45

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

‎src/pg_probackup.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
#include"utils/thread.h"
2121
#include<time.h>
2222

23-
constchar*PROGRAM_NAME=NULL;
23+
constchar*PROGRAM_NAME=NULL;/* PROGRAM_NAME_FULL without .exe suffix
24+
* if any */
25+
constchar*PROGRAM_NAME_FULL=NULL;
2426
constchar*PROGRAM_FULL_PATH=NULL;
2527
constchar*PROGRAM_URL="https://github.com/postgrespro/pg_probackup";
2628
constchar*PROGRAM_EMAIL="https://github.com/postgrespro/pg_probackup/issues";
@@ -45,8 +47,6 @@ typedef enum ProbackupSubcmd
4547
}ProbackupSubcmd;
4648

4749

48-
char*pg_probackup;/* Program name (argv[0]) */
49-
5050
/* directory options */
5151
char*backup_path=NULL;
5252
/*
@@ -235,7 +235,7 @@ main(int argc, char *argv[])
235235
structstatstat_buf;
236236
intrc;
237237

238-
pg_probackup=argv[0];
238+
PROGRAM_NAME_FULL=argv[0];
239239

240240
/* Initialize current backup */
241241
pgBackupInit(&current);

‎src/pg_probackup.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636

3737
/* pgut client variables and full path */
3838
externconstchar*PROGRAM_NAME;
39+
externconstchar*PROGRAM_NAME_FULL;
3940
externconstchar*PROGRAM_FULL_PATH;
4041
externconstchar*PROGRAM_URL;
4142
externconstchar*PROGRAM_EMAIL;
@@ -412,7 +413,6 @@ typedef struct BackupPageHeader
412413
#defineIsSshProtocol() (instance_config.remote.host && strcmp(instance_config.remote.proto, "ssh") == 0)
413414

414415
/* directory options */
415-
externchar*pg_probackup;
416416
externchar*backup_path;
417417
externcharbackup_instance_path[MAXPGPATH];
418418
externchararclog_path[MAXPGPATH];
@@ -472,7 +472,7 @@ extern const char *pgdata_exclude_dir[];
472472

473473
/* in backup.c */
474474
externintdo_backup(time_tstart_time,boolno_validate);
475-
externvoiddo_checkdb(boolneed_amcheck,ConnectionOptionsconn_opt,
475+
externvoiddo_checkdb(boolneed_amcheck,ConnectionOptionsconn_opt,
476476
char*pgdata);
477477
externBackupModeparse_backup_mode(constchar*value);
478478
externconstchar*deparse_backup_mode(BackupModemode);

‎src/utils/remote.c‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ bool launch_agent(void)
9191

9292
ssh_argc=0;
9393
#ifdefWIN32
94-
ssh_argv[ssh_argc++]=pg_probackup;
94+
ssh_argv[ssh_argc++]=PROGRAM_NAME_FULL;
9595
ssh_argv[ssh_argc++]="ssh";
9696
ssh_argc+=2;/* reserve space for pipe descriptors */
9797
#endif
@@ -129,7 +129,7 @@ bool launch_agent(void)
129129

130130
if (instance_config.remote.path)
131131
{
132-
charconst*probackup=pg_probackup;
132+
charconst*probackup=PROGRAM_NAME_FULL;
133133
char*sep=strrchr(probackup,'/');
134134
if (sep!=NULL) {
135135
probackup=sep+1;
@@ -141,25 +141,25 @@ bool launch_agent(void)
141141
probackup=sep+1;
142142
}
143143
}
144-
if (needs_quotes(instance_config.remote.path)||needs_quotes(pg_probackup))
144+
if (needs_quotes(instance_config.remote.path)||needs_quotes(PROGRAM_NAME_FULL))
145145
snprintf(cmd,sizeof(cmd),"\"%s\\%s\" agent %s",
146146
instance_config.remote.path,probackup,PROGRAM_VERSION);
147147
else
148148
snprintf(cmd,sizeof(cmd),"%s\\%s agent %s",
149149
instance_config.remote.path,probackup,PROGRAM_VERSION);
150150
#else
151-
if (needs_quotes(instance_config.remote.path)||needs_quotes(pg_probackup))
151+
if (needs_quotes(instance_config.remote.path)||needs_quotes(PROGRAM_NAME_FULL))
152152
snprintf(cmd,sizeof(cmd),"\"%s/%s\" agent %s",
153153
instance_config.remote.path,probackup,PROGRAM_VERSION);
154154
else
155155
snprintf(cmd,sizeof(cmd),"%s/%s agent %s",
156156
instance_config.remote.path,probackup,PROGRAM_VERSION);
157157
#endif
158158
}else {
159-
if (needs_quotes(pg_probackup))
160-
snprintf(cmd,sizeof(cmd),"\"%s\" agent %s",pg_probackup,PROGRAM_VERSION);
159+
if (needs_quotes(PROGRAM_NAME_FULL))
160+
snprintf(cmd,sizeof(cmd),"\"%s\" agent %s",PROGRAM_NAME_FULL,PROGRAM_VERSION);
161161
else
162-
snprintf(cmd,sizeof(cmd),"%s agent %s",pg_probackup,PROGRAM_VERSION);
162+
snprintf(cmd,sizeof(cmd),"%s agent %s",PROGRAM_NAME_FULL,PROGRAM_VERSION);
163163
}
164164

165165
#ifdefWIN32

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp