Skip to content

Commit 1de877d

Browse files
author
Michael Paquier
committed
Fix server status not correctly fetched
This error has been introduced by ebe2166 because of some incorrect refactoring.
1 parent 10ea742 commit 1de877d

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

status.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,16 @@ get_pgpid(void)
4949
elog(ERROR_SYSTEM, _("could not open PID file \"%s\": %s\n"),
5050
pid_file, strerror(errno));
5151
}
52-
if (fscanf(pidf, "%ld", &pid) != 1)
53-
{
54-
/* Is the file empty? */
55-
if (ftell(pidf) == 0 && feof(pidf))
56-
elog(ERROR_SYSTEM, _("the PID file \"%s\" is empty\n"),
57-
pid_file);
58-
else
59-
elog(ERROR_SYSTEM, _("invalid data in PID file \"%s\"\n"),
60-
pid_file);
61-
}
52+
}
53+
if (fscanf(pidf, "%ld", &pid) != 1)
54+
{
55+
/* Is the file empty? */
56+
if (ftell(pidf) == 0 && feof(pidf))
57+
elog(ERROR_SYSTEM, _("the PID file \"%s\" is empty\n"),
58+
pid_file);
59+
else
60+
elog(ERROR_SYSTEM, _("invalid data in PID file \"%s\"\n"),
61+
pid_file);
6262
}
6363
fclose(pidf);
6464
return (pgpid_t) pid;

0 commit comments

Comments
 (0)