* Check that pg_control exists in the correct location in the data directory. * * No attempt is made to validate the contents of pg_control here. This is * just a sanity check to see if we are looking at a real data directory. */
| 1791 | * just a sanity check to see if we are looking at a real data directory. |
| 1792 | */ |
| 1793 | static void |
| 1794 | checkControlFile(void) |
| 1795 | { |
| 1796 | char path[MAXPGPATH]; |
| 1797 | FILE *fp; |
| 1798 | |
| 1799 | snprintf(path, sizeof(path), "%s/global/pg_control", DataDir); |
| 1800 | |
| 1801 | fp = AllocateFile(path, PG_BINARY_R); |
| 1802 | if (fp == NULL) |
| 1803 | { |
| 1804 | write_stderr("%s: could not find the database system\n" |
| 1805 | "Expected to find it in the directory \"%s\",\n" |
| 1806 | "but could not open file \"%s\": %s\n", |
| 1807 | progname, DataDir, path, strerror(errno)); |
| 1808 | ExitPostmaster(2); |
| 1809 | } |
| 1810 | FreeFile(fp); |
| 1811 | } |
| 1812 | |
| 1813 | |
| 1814 | /* |
no test coverage detected