|
39 | 39 | * Portions Copyright (c) 1994, Regents of the University of California |
40 | 40 | * Portions taken from FreeBSD. |
41 | 41 | * |
42 | | - * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.45 2004/08/01 05:59:13 momjian Exp $ |
| 42 | + * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.46 2004/08/01 06:19:23 momjian Exp $ |
43 | 43 | * |
44 | 44 | *------------------------------------------------------------------------- |
45 | 45 | */ |
@@ -146,7 +146,6 @@ char backend_exec[MAXPGPATH]; |
146 | 146 |
|
147 | 147 | static void *xmalloc(size_t size); |
148 | 148 | static char *xstrdup(const char *s); |
149 | | -static bool rmtree(char *path, bool rmtopdir); |
150 | 149 | static char **replace_token(char **lines, char *token, char *replacement); |
151 | 150 | static char **readfile(char *path); |
152 | 151 | static void writefile(char *path, char **lines); |
@@ -251,30 +250,6 @@ xstrdup(const char *s) |
251 | 250 | return result; |
252 | 251 | } |
253 | 252 |
|
254 | | -/* |
255 | | - * delete a directory tree recursively |
256 | | - * assumes path points to a valid directory |
257 | | - * deletes everything under path |
258 | | - * if rmtopdir is true deletes the directory too |
259 | | - */ |
260 | | -static bool |
261 | | -rmtree(char *path, bool rmtopdir) |
262 | | -{ |
263 | | - char buf[MAXPGPATH + 64]; |
264 | | - |
265 | | -#ifndef WIN32 |
266 | | - /* doesn't handle .* files, but we don't make any... */ |
267 | | - snprintf(buf, sizeof(buf), "rm -rf \"%s\"%s", path, |
268 | | - rmtopdir ? "" : "/*"); |
269 | | -#else |
270 | | - snprintf(buf, sizeof(buf), "%s /s /q \"%s\"", |
271 | | - rmtopdir ? "rmdir" : "del", path); |
272 | | -#endif |
273 | | - |
274 | | - return !system(buf); |
275 | | -} |
276 | | - |
277 | | - |
278 | 253 | /* |
279 | 254 | * make a copy of the array of lines, with token replaced by replacement |
280 | 255 | * the first time it occurs on each line. |
|
0 commit comments