mirror of
https://github.com/postgres/postgres.git
synced 2025-06-04 00:02:37 -04:00
In pg_upgrade, clean up handling of invalid directory specification by
checking the stat() errno value more strictly.
This commit is contained in:
parent
772a5f1e5b
commit
1f35944607
@ -70,9 +70,9 @@ is_server_running(const char *datadir)
|
|||||||
|
|
||||||
if ((fd = open(path, O_RDONLY, 0)) < 0)
|
if ((fd = open(path, O_RDONLY, 0)) < 0)
|
||||||
{
|
{
|
||||||
if (errno != ENOENT)
|
/* ENOTDIR means we will throw a more useful error later */
|
||||||
/* issue a warning but continue so we can throw a clearer error later */
|
if (errno != ENOENT && errno != ENOTDIR)
|
||||||
pg_log(PG_WARNING, "could not open file \"%s\" for reading\n",
|
pg_log(PG_FATAL, "could not open file \"%s\" for reading\n",
|
||||||
path);
|
path);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user