|
12 | 12 | * This is a C implementation of the previous shell script for setting up a |
13 | 13 | * PostgreSQL cluster location, and should be highly compatible with it. |
14 | 14 | * |
15 | | - * $Header: /cvsroot/pgsql/src/bin/initdb/initdb.c,v 1.5 2003/11/1315:01:40 momjian Exp $ |
| 15 | + * $Header: /cvsroot/pgsql/src/bin/initdb/initdb.c,v 1.6 2003/11/1320:12:47 momjian Exp $ |
16 | 16 | * |
17 | 17 | * TODO: |
18 | 18 | * - clean up find_postgres code and return values |
@@ -122,6 +122,7 @@ static void canonicalize_path(char *); |
122 | 122 |
|
123 | 123 | #ifdefWIN32 |
124 | 124 | staticchar*expanded_path(char*); |
| 125 | + |
125 | 126 | #else |
126 | 127 | #defineexpanded_path(x) (x) |
127 | 128 | #endif |
@@ -246,10 +247,10 @@ rmtree(char *path, bool rmtopdir) |
246 | 247 | #ifndefWIN32 |
247 | 248 | /* doesn't handle .* files */ |
248 | 249 | snprintf(buf,sizeof(buf),"rm -rf '%s%s'",path, |
249 | | -rmtopdir ?"" :"/*"); |
| 250 | +rmtopdir ?"" :"/*"); |
250 | 251 | #else |
251 | 252 | snprintf(buf,sizeof(buf),"%s /s /q \"%s\"", |
252 | | -rmtopdir ?"rmdir" :"del",path); |
| 253 | +rmtopdir ?"rmdir" :"del",path); |
253 | 254 | #endif |
254 | 255 |
|
255 | 256 | return !system(buf); |
@@ -816,6 +817,7 @@ find_postgres(char *path) |
816 | 817 | returnFIND_NOT_REGFILE; |
817 | 818 |
|
818 | 819 | #ifndefWIN32 |
| 820 | + |
819 | 821 | /* |
820 | 822 | * Only unix requires this test, on WIN32 an .exe file should be |
821 | 823 | * executable |
@@ -859,7 +861,7 @@ expanded_path(char *path) |
859 | 861 | canonicalize_path(abspath); |
860 | 862 | returnxstrdup(abspath); |
861 | 863 | } |
862 | | -#endif |
| 864 | +#endif |
863 | 865 |
|
864 | 866 | /* |
865 | 867 | * set the paths pointing to postgres |
@@ -1045,7 +1047,7 @@ test_buffers(void) |
1045 | 1047 | for (i=0;i<len;i++) |
1046 | 1048 | { |
1047 | 1049 | snprintf(cmd,sizeof(cmd),format,pgpath,bufs[i],n_connections, |
1048 | | -DEVNULL,DEVNULL); |
| 1050 | +DEVNULL,DEVNULL); |
1049 | 1051 | status=system(cmd); |
1050 | 1052 | if (status==0) |
1051 | 1053 | break; |
@@ -1286,7 +1288,7 @@ get_set_pwd(void) |
1286 | 1288 | PG_CMD_OPEN; |
1287 | 1289 |
|
1288 | 1290 | if (fprintf(pg, |
1289 | | -"ALTER USER \"%s\" WITH PASSWORD '%s';\n",username,pwd1)<0) |
| 1291 | +"ALTER USER \"%s\" WITH PASSWORD '%s';\n",username,pwd1)<0) |
1290 | 1292 | { |
1291 | 1293 | /* write failure */ |
1292 | 1294 | exit_nicely(); |
@@ -2276,9 +2278,9 @@ main(int argc, char *argv[]) |
2276 | 2278 | check_input(system_views_file); |
2277 | 2279 |
|
2278 | 2280 | printf("The files belonging to this database system will be owned " |
2279 | | -"by user \"%s\".\n" |
2280 | | -"This user must also own the server process.\n\n", |
2281 | | -effective_user); |
| 2281 | +"by user \"%s\".\n" |
| 2282 | +"This user must also own the server process.\n\n", |
| 2283 | +effective_user); |
2282 | 2284 |
|
2283 | 2285 | setlocales(); |
2284 | 2286 |
|
@@ -2413,8 +2415,8 @@ main(int argc, char *argv[]) |
2413 | 2415 | " %s%s%s/postmaster -D %s%s%s\n" |
2414 | 2416 | "or\n" |
2415 | 2417 | " %s%s%s/pg_ctl -D %s%s%s -l logfile start\n\n", |
2416 | | -QUOTE_PATH,pgpath,QUOTE_PATH,QUOTE_PATH,pg_data,QUOTE_PATH, |
2417 | | -QUOTE_PATH,pgpath,QUOTE_PATH,QUOTE_PATH,pg_data,QUOTE_PATH); |
| 2418 | +QUOTE_PATH,pgpath,QUOTE_PATH,QUOTE_PATH,pg_data,QUOTE_PATH, |
| 2419 | +QUOTE_PATH,pgpath,QUOTE_PATH,QUOTE_PATH,pg_data,QUOTE_PATH); |
2418 | 2420 |
|
2419 | 2421 | return0; |
2420 | 2422 | } |