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
e8a3e6b8
Commit
e8a3e6b8
authored
Jul 10, 2005
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename xmalloc to pg_malloc for consistency with psql usage.
Add missing plperl include.
parent
f86c63ab
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
25 deletions
+26
-25
src/bin/initdb/initdb.c
src/bin/initdb/initdb.c
+16
-16
src/bin/pg_ctl/pg_ctl.c
src/bin/pg_ctl/pg_ctl.c
+8
-8
src/pl/plperl/plperl.c
src/pl/plperl/plperl.c
+2
-1
No files found.
src/bin/initdb/initdb.c
View file @
e8a3e6b8
...
...
@@ -42,7 +42,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
* Portions taken from FreeBSD.
*
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.9
1 2005/07/07 20:39:59 tgl
Exp $
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.9
2 2005/07/10 16:13:12 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -144,7 +144,7 @@ static const char *backend_options = "-F -O -c search_path=pg_catalog -c exit_on
static
char
bin_path
[
MAXPGPATH
];
static
char
backend_exec
[
MAXPGPATH
];
static
void
*
x
malloc
(
size_t
size
);
static
void
*
pg_
malloc
(
size_t
size
);
static
char
*
xstrdup
(
const
char
*
s
);
static
char
**
replace_token
(
char
**
lines
,
const
char
*
token
,
const
char
*
replacement
);
...
...
@@ -241,7 +241,7 @@ do { \
* rmtree() which needs memory allocation. So we just exit with a bang.
*/
static
void
*
x
malloc
(
size_t
size
)
pg_
malloc
(
size_t
size
)
{
void
*
result
;
...
...
@@ -288,7 +288,7 @@ replace_token(char **lines, const char *token, const char *replacement)
for
(
i
=
0
;
lines
[
i
];
i
++
)
numlines
++
;
result
=
(
char
**
)
x
malloc
(
numlines
*
sizeof
(
char
*
));
result
=
(
char
**
)
pg_
malloc
(
numlines
*
sizeof
(
char
*
));
toklen
=
strlen
(
token
);
replen
=
strlen
(
replacement
);
...
...
@@ -309,7 +309,7 @@ replace_token(char **lines, const char *token, const char *replacement)
/* if we get here a change is needed - set up new line */
newline
=
(
char
*
)
x
malloc
(
strlen
(
lines
[
i
])
+
diff
+
1
);
newline
=
(
char
*
)
pg_
malloc
(
strlen
(
lines
[
i
])
+
diff
+
1
);
pre
=
where
-
lines
[
i
];
...
...
@@ -341,7 +341,7 @@ filter_lines_with_token(char **lines, const char *token)
for
(
i
=
0
;
lines
[
i
];
i
++
)
numlines
++
;
result
=
(
char
**
)
x
malloc
(
numlines
*
sizeof
(
char
*
));
result
=
(
char
**
)
pg_
malloc
(
numlines
*
sizeof
(
char
*
));
for
(
src
=
0
,
dst
=
0
;
src
<
numlines
;
src
++
)
{
...
...
@@ -397,8 +397,8 @@ readfile(char *path)
/* set up the result and the line buffer */
result
=
(
char
**
)
x
malloc
((
nlines
+
2
)
*
sizeof
(
char
*
));
buffer
=
(
char
*
)
x
malloc
(
maxlength
+
2
);
result
=
(
char
**
)
pg_
malloc
((
nlines
+
2
)
*
sizeof
(
char
*
));
buffer
=
(
char
*
)
pg_
malloc
(
maxlength
+
2
);
/* now reprocess the file and store the lines */
...
...
@@ -958,7 +958,7 @@ mkdatadir(const char *subdir)
{
char
*
path
;
path
=
x
malloc
(
strlen
(
pg_data
)
+
2
+
path
=
pg_
malloc
(
strlen
(
pg_data
)
+
2
+
(
subdir
==
NULL
?
0
:
strlen
(
subdir
)));
if
(
subdir
!=
NULL
)
...
...
@@ -982,7 +982,7 @@ mkdatadir(const char *subdir)
static
void
set_input
(
char
**
dest
,
char
*
filename
)
{
*
dest
=
x
malloc
(
strlen
(
share_path
)
+
strlen
(
filename
)
+
2
);
*
dest
=
pg_
malloc
(
strlen
(
share_path
)
+
strlen
(
filename
)
+
2
);
sprintf
(
*
dest
,
"%s/%s"
,
share_path
,
filename
);
}
...
...
@@ -1017,12 +1017,12 @@ set_short_version(char *short_version, char *extrapath)
if
(
extrapath
==
NULL
)
{
path
=
x
malloc
(
strlen
(
pg_data
)
+
12
);
path
=
pg_
malloc
(
strlen
(
pg_data
)
+
12
);
sprintf
(
path
,
"%s/PG_VERSION"
,
pg_data
);
}
else
{
path
=
x
malloc
(
strlen
(
pg_data
)
+
strlen
(
extrapath
)
+
13
);
path
=
pg_
malloc
(
strlen
(
pg_data
)
+
strlen
(
extrapath
)
+
13
);
sprintf
(
path
,
"%s/%s/PG_VERSION"
,
pg_data
,
extrapath
);
}
version_file
=
fopen
(
path
,
PG_BINARY_W
);
...
...
@@ -1050,7 +1050,7 @@ set_null_conf(void)
FILE
*
conf_file
;
char
*
path
;
path
=
x
malloc
(
strlen
(
pg_data
)
+
17
);
path
=
pg_
malloc
(
strlen
(
pg_data
)
+
17
);
sprintf
(
path
,
"%s/postgresql.conf"
,
pg_data
);
conf_file
=
fopen
(
path
,
PG_BINARY_W
);
if
(
conf_file
==
NULL
)
...
...
@@ -1989,7 +1989,7 @@ escape_quotes(const char *src)
{
int
len
=
strlen
(
src
),
i
,
j
;
char
*
result
=
x
malloc
(
len
*
2
+
1
);
char
*
result
=
pg_
malloc
(
len
*
2
+
1
);
for
(
i
=
0
,
j
=
0
;
i
<
len
;
i
++
)
{
...
...
@@ -2350,7 +2350,7 @@ main(int argc, char *argv[])
* would especially need quotes otherwise on Windows because paths
* there are most likely to have embedded spaces.
*/
pgdenv
=
x
malloc
(
8
+
strlen
(
pg_data
));
pgdenv
=
pg_
malloc
(
8
+
strlen
(
pg_data
));
sprintf
(
pgdenv
,
"PGDATA=%s"
,
pg_data
);
putenv
(
pgdenv
);
...
...
@@ -2385,7 +2385,7 @@ main(int argc, char *argv[])
if
(
!
share_path
)
{
share_path
=
x
malloc
(
MAXPGPATH
);
share_path
=
pg_
malloc
(
MAXPGPATH
);
get_share_path
(
backend_exec
,
share_path
);
}
else
if
(
!
is_absolute_path
(
share_path
))
...
...
src/bin/pg_ctl/pg_ctl.c
View file @
e8a3e6b8
...
...
@@ -4,7 +4,7 @@
*
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.5
8 2005/06/21 04:02:32 tgl
Exp $
* $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.5
9 2005/07/10 16:13:13 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -88,7 +88,7 @@ write_stderr(const char *fmt,...)
/* This extension allows gcc to check the format string for consistency with
the supplied arguments. */
__attribute__
((
format
(
printf
,
1
,
2
)));
static
void
*
x
malloc
(
size_t
size
);
static
void
*
pg_
malloc
(
size_t
size
);
static
char
*
xstrdup
(
const
char
*
s
);
static
void
do_advice
(
void
);
static
void
do_help
(
void
);
...
...
@@ -191,7 +191,7 @@ write_stderr(const char *fmt,...)
*/
static
void
*
x
malloc
(
size_t
size
)
pg_
malloc
(
size_t
size
)
{
void
*
result
;
...
...
@@ -301,8 +301,8 @@ readfile(const char *path)
maxlength
=
linelen
;
/* set up the result and the line buffer */
result
=
(
char
**
)
x
malloc
((
nlines
+
1
)
*
sizeof
(
char
*
));
buffer
=
(
char
*
)
x
malloc
(
maxlength
+
1
);
result
=
(
char
**
)
pg_
malloc
((
nlines
+
1
)
*
sizeof
(
char
*
));
buffer
=
(
char
*
)
pg_
malloc
(
maxlength
+
1
);
/* now reprocess the file and store the lines */
rewind
(
infile
);
...
...
@@ -539,7 +539,7 @@ do_start(void)
char
*
postmaster_path
;
int
ret
;
postmaster_path
=
x
malloc
(
MAXPGPATH
);
postmaster_path
=
pg_
malloc
(
MAXPGPATH
);
if
((
ret
=
find_other_exec
(
argv0
,
"postmaster"
,
PM_VERSIONSTR
,
postmaster_path
))
<
0
)
...
...
@@ -1353,7 +1353,7 @@ main(int argc, char **argv)
case
'D'
:
{
char
*
pgdata_D
;
char
*
env_var
=
x
malloc
(
strlen
(
optarg
)
+
8
);
char
*
env_var
=
pg_
malloc
(
strlen
(
optarg
)
+
8
);
pgdata_D
=
xstrdup
(
optarg
);
canonicalize_path
(
pgdata_D
);
...
...
@@ -1366,7 +1366,7 @@ main(int argc, char **argv)
* variable but we do -D too for clearer
* postmaster 'ps' display
*/
pgdata_opt
=
x
malloc
(
strlen
(
pgdata_D
)
+
7
);
pgdata_opt
=
pg_
malloc
(
strlen
(
pgdata_D
)
+
7
);
snprintf
(
pgdata_opt
,
strlen
(
pgdata_D
)
+
7
,
"-D
\"
%s
\"
"
,
pgdata_D
);
...
...
src/pl/plperl/plperl.c
View file @
e8a3e6b8
...
...
@@ -33,7 +33,7 @@
* ENHANCEMENTS, OR MODIFICATIONS.
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.8
3 2005/07/10 15:32:47
momjian Exp $
* $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.8
4 2005/07/10 16:13:13
momjian Exp $
*
**********************************************************************/
...
...
@@ -61,6 +61,7 @@
#include "perl.h"
#include "XSUB.h"
#include "ppport.h"
#include "spi_internal.h"
/* just in case these symbols aren't provided */
#ifndef pTHX_
...
...
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