|
11 | 11 |
|
12 | 12 |
|
13 | 13 | staticvoidcheckBinDir(migratorContext*ctx,ClusterInfo*cluster); |
14 | | -staticintcheck_exec(migratorContext*ctx,constchar*dir,constchar*cmdName, |
15 | | -constchar*alternative); |
| 14 | +staticintcheck_exec(migratorContext*ctx,constchar*dir,constchar*cmdName); |
16 | 15 | staticconstchar*validate_exec(constchar*path); |
17 | 16 | staticintcheck_data_dir(migratorContext*ctx,constchar*pg_data); |
18 | 17 |
|
@@ -89,22 +88,10 @@ verify_directories(migratorContext *ctx) |
89 | 88 | staticvoid |
90 | 89 | checkBinDir(migratorContext*ctx,ClusterInfo*cluster) |
91 | 90 | { |
92 | | -check_exec(ctx,cluster->bindir,"postgres","edb-postgres"); |
93 | | -check_exec(ctx,cluster->bindir,"pg_ctl",NULL); |
94 | | -check_exec(ctx,cluster->bindir,"pg_dumpall",NULL); |
95 | | - |
96 | | -#ifdefEDB_NATIVE_LANG |
97 | | -/* check for edb-psql first because we need to detect EDB AS */ |
98 | | -if (check_exec(ctx,cluster->bindir,"edb-psql","psql")==1) |
99 | | -{ |
100 | | -cluster->psql_exe="edb-psql"; |
101 | | -cluster->is_edb_as= true; |
102 | | -} |
103 | | -else |
104 | | -#else |
105 | | -if (check_exec(ctx,cluster->bindir,"psql",NULL)==1) |
106 | | -#endif |
107 | | -cluster->psql_exe="psql"; |
| 91 | +check_exec(ctx,cluster->bindir,"postgres"); |
| 92 | +check_exec(ctx,cluster->bindir,"psql"); |
| 93 | +check_exec(ctx,cluster->bindir,"pg_ctl"); |
| 94 | +check_exec(ctx,cluster->bindir,"pg_dumpall"); |
108 | 95 | } |
109 | 96 |
|
110 | 97 |
|
@@ -146,30 +133,17 @@ is_server_running(migratorContext *ctx, const char *datadir) |
146 | 133 | *a valid executable, this function returns 0 to indicated failure. |
147 | 134 | */ |
148 | 135 | staticint |
149 | | -check_exec(migratorContext*ctx,constchar*dir,constchar*cmdName, |
150 | | -constchar*alternative) |
| 136 | +check_exec(migratorContext*ctx,constchar*dir,constchar*cmdName) |
151 | 137 | { |
152 | 138 | charpath[MAXPGPATH]; |
153 | 139 | constchar*errMsg; |
154 | 140 |
|
155 | 141 | snprintf(path,sizeof(path),"%s%c%s",dir,pathSeparator,cmdName); |
156 | 142 |
|
157 | 143 | if ((errMsg=validate_exec(path))==NULL) |
158 | | -{ |
159 | 144 | return1;/* 1 -> first alternative OK */ |
160 | | -} |
161 | 145 | else |
162 | | -{ |
163 | | -if (alternative) |
164 | | -{ |
165 | | -report_status(ctx,PG_WARNING,"check for %s warning: %s", |
166 | | -cmdName,errMsg); |
167 | | -if (check_exec(ctx,dir,alternative,NULL)==1) |
168 | | -return2;/* 2 -> second alternative OK */ |
169 | | -} |
170 | | -else |
171 | | -pg_log(ctx,PG_FATAL,"check for %s failed - %s\n",cmdName,errMsg); |
172 | | -} |
| 146 | +pg_log(ctx,PG_FATAL,"check for %s failed - %s\n",cmdName,errMsg); |
173 | 147 |
|
174 | 148 | return0;/* 0 -> neither alternative is acceptable */ |
175 | 149 | } |
|