Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
55f8fc3b
Commit
55f8fc3b
authored
Jun 30, 2001
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
portability enhancements
parent
2ab0f11a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
src/backend/postmaster/pgstat.c
src/backend/postmaster/pgstat.c
+9
-11
No files found.
src/backend/postmaster/pgstat.c
View file @
55f8fc3b
...
...
@@ -19,11 +19,11 @@
*
* Copyright (c) 2001, PostgreSQL Global Development Group
*
* $Id: pgstat.c,v 1.
2 2001/06/29 16:29:37 wieck
Exp $
* $Id: pgstat.c,v 1.
3 2001/06/30 19:01:27 petere
Exp $
* ----------
*/
#include
<stdio.h>
#include <stdlib.h>
#include
"postgres.h"
#include <unistd.h>
#include <fcntl.h>
...
...
@@ -37,8 +37,6 @@
#include <errno.h>
#include <signal.h>
#include "postgres.h"
#include "miscadmin.h"
#include "utils/memutils.h"
#include "storage/backendid.h"
...
...
@@ -88,8 +86,8 @@ static HTAB *pgStatBeDead = NULL;
static
PgStat_StatBeEntry
*
pgStatBeTable
=
NULL
;
static
int
pgStatNumBackends
=
0
;
static
char
pgStat_tmpfname
[
PATH_MAX
];
static
char
pgStat_fname
[
PATH_MAX
];
static
char
pgStat_tmpfname
[
MAXPGPATH
];
static
char
pgStat_fname
[
MAXPGPATH
];
/* ----------
...
...
@@ -140,9 +138,9 @@ pgstat_init(void)
/*
* Initialize the filenames for the status reports.
*/
snprintf
(
pgStat_tmpfname
,
PATH_MAX
-
1
,
snprintf
(
pgStat_tmpfname
,
MAXPGPATH
,
PGSTAT_STAT_TMPFILE
,
DataDir
,
getpid
());
snprintf
(
pgStat_fname
,
PATH_MAX
-
1
,
snprintf
(
pgStat_fname
,
MAXPGPATH
,
PGSTAT_STAT_FILENAME
,
DataDir
);
/*
...
...
@@ -1696,7 +1694,7 @@ pgstat_write_statsfile(void)
* Open the statistics temp file to write out
* the current values.
*/
fpout
=
fopen
(
pgStat_tmpfname
,
"w"
);
fpout
=
fopen
(
pgStat_tmpfname
,
PG_BINARY_W
);
if
(
fpout
==
NULL
)
{
fprintf
(
stderr
,
"PGSTAT: cannot open temp stats file
\n
PGSTAT: "
);
...
...
@@ -1954,7 +1952,7 @@ pgstat_read_statsfile(HTAB **dbhash, Oid onlydb,
* simply return zero for anything and the collector simply
* starts from scratch with empty counters.
*/
if
((
fpin
=
fopen
(
pgStat_fname
,
"r"
))
==
NULL
)
if
((
fpin
=
fopen
(
pgStat_fname
,
PG_BINARY_R
))
==
NULL
)
return
;
/*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment