diff options
Diffstat (limited to 'src/bin/pg_upgrade/exec.c')
-rw-r--r-- | src/bin/pg_upgrade/exec.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/bin/pg_upgrade/exec.c b/src/bin/pg_upgrade/exec.c index 64276223d50..aa3d2f88ed8 100644 --- a/src/bin/pg_upgrade/exec.c +++ b/src/bin/pg_upgrade/exec.c @@ -423,18 +423,11 @@ check_exec(const char *dir, const char *program, bool check_version) char line[MAXPGPATH]; char cmd[MAXPGPATH]; char versionstr[128]; - int ret; snprintf(path, sizeof(path), "%s/%s", dir, program); - ret = validate_exec(path); - - if (ret == -1) - pg_fatal("check for \"%s\" failed: does not exist or cannot be executed", - path); - else if (ret == -2) - pg_fatal("check for \"%s\" failed: cannot read (permission denied)", - path); + if (validate_exec(path) != 0) + pg_fatal("check for \"%s\" failed: %m", path); snprintf(cmd, sizeof(cmd), "\"%s\" -V", path); |