diff options
author | Bruce Momjian | 2011-05-19 02:22:40 +0000 |
---|---|---|
committer | Bruce Momjian | 2011-05-19 02:22:40 +0000 |
commit | 1f35944607f1ede7dbb1dc3283d955b96f04ea5e (patch) | |
tree | b76a2575728ca47a8980723dbc01a828d78f67dc | |
parent | 772a5f1e5b343d07e907ef7f36fa36d190d55912 (diff) |
In pg_upgrade, clean up handling of invalid directory specification by
checking the stat() errno value more strictly.
-rw-r--r-- | contrib/pg_upgrade/exec.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/pg_upgrade/exec.c b/contrib/pg_upgrade/exec.c index a8f455d2b8..93c923c556 100644 --- a/contrib/pg_upgrade/exec.c +++ b/contrib/pg_upgrade/exec.c @@ -70,9 +70,9 @@ is_server_running(const char *datadir) if ((fd = open(path, O_RDONLY, 0)) < 0) { - if (errno != ENOENT) - /* issue a warning but continue so we can throw a clearer error later */ - pg_log(PG_WARNING, "could not open file \"%s\" for reading\n", + /* ENOTDIR means we will throw a more useful error later */ + if (errno != ENOENT && errno != ENOTDIR) + pg_log(PG_FATAL, "could not open file \"%s\" for reading\n", path); return false; |