Skip to content

Commit 1f35944

Browse files
committed
In pg_upgrade, clean up handling of invalid directory specification by
checking the stat() errno value more strictly.
1 parent 772a5f1 commit 1f35944

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

contrib/pg_upgrade/exec.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ is_server_running(const char *datadir)
7070

7171
if ((fd = open(path, O_RDONLY, 0)) < 0)
7272
{
73-
if (errno != ENOENT)
74-
/* issue a warning but continue so we can throw a clearer error later */
75-
pg_log(PG_WARNING, "could not open file \"%s\" for reading\n",
73+
/* ENOTDIR means we will throw a more useful error later */
74+
if (errno != ENOENT && errno != ENOTDIR)
75+
pg_log(PG_FATAL, "could not open file \"%s\" for reading\n",
7676
path);
7777

7878
return false;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy