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
40f456ce
Commit
40f456ce
authored
Mar 16, 2004
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove double-rename used by Win32 on busy files. Not needed anymore.
parent
e2d8c1b2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
46 deletions
+2
-46
src/backend/commands/user.c
src/backend/commands/user.c
+1
-33
src/backend/utils/cache/relcache.c
src/backend/utils/cache/relcache.c
+1
-13
No files found.
src/backend/commands/user.c
View file @
40f456ce
...
...
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/backend/commands/user.c,v 1.13
8 2004/02/25 19:41:22
momjian Exp $
* $PostgreSQL: pgsql/src/backend/commands/user.c,v 1.13
9 2004/03/16 05:05:57
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -140,10 +140,6 @@ write_group_file(Relation grel)
bufsize
=
strlen
(
filename
)
+
12
;
tempname
=
(
char
*
)
palloc
(
bufsize
);
snprintf
(
tempname
,
bufsize
,
"%s.%d"
,
filename
,
MyProcPid
);
#if defined(WIN32) || defined(__CYGWIN__)
filename
=
repalloc
(
filename
,
strlen
(
filename
)
+
1
+
strlen
(
".new"
));
strcat
(
filename
,
".new"
);
#endif
oumask
=
umask
((
mode_t
)
077
);
fp
=
AllocateFile
(
tempname
,
"w"
);
...
...
@@ -291,10 +287,6 @@ write_user_file(Relation urel)
bufsize
=
strlen
(
filename
)
+
12
;
tempname
=
(
char
*
)
palloc
(
bufsize
);
snprintf
(
tempname
,
bufsize
,
"%s.%d"
,
filename
,
MyProcPid
);
#if defined(WIN32) || defined(__CYGWIN__)
filename
=
repalloc
(
filename
,
strlen
(
filename
)
+
1
+
strlen
(
".new"
));
strcat
(
filename
,
".new"
);
#endif
oumask
=
umask
((
mode_t
)
077
);
fp
=
AllocateFile
(
tempname
,
"w"
);
...
...
@@ -466,18 +458,6 @@ AtEOXact_UpdatePasswordFile(bool isCommit)
user_file_update_needed
=
false
;
write_user_file
(
urel
);
heap_close
(
urel
,
NoLock
);
#if defined(WIN32) || defined(__CYGWIN__)
{
/* Rename active file while not holding an exclusive lock */
char
*
filename
=
user_getfilename
(),
*
filename_new
;
filename_new
=
palloc
(
strlen
(
filename
)
+
1
+
strlen
(
".new"
));
sprintf
(
filename_new
,
"%s.new"
,
filename
);
rename
(
filename_new
,
filename
);
pfree
(
filename
);
pfree
(
filename_new
);
}
#endif
}
if
(
group_file_update_needed
)
...
...
@@ -485,18 +465,6 @@ AtEOXact_UpdatePasswordFile(bool isCommit)
group_file_update_needed
=
false
;
write_group_file
(
grel
);
heap_close
(
grel
,
NoLock
);
#if defined(WIN32) || defined(__CYGWIN__)
{
/* Rename active file while not holding an exclusive lock */
char
*
filename
=
group_getfilename
(),
*
filename_new
;
filename_new
=
palloc
(
strlen
(
filename
)
+
1
+
strlen
(
".new"
));
sprintf
(
filename_new
,
"%s.new"
,
filename
);
rename
(
filename_new
,
filename
);
pfree
(
filename
);
pfree
(
filename_new
);
}
#endif
}
/*
...
...
src/backend/utils/cache/relcache.c
View file @
40f456ce
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.
199 2004/03/14 23:41:27 tgl
Exp $
* $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.
200 2004/03/16 05:05:58 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -3278,20 +3278,8 @@ write_relcache_init_file(void)
* OK, rename the temp file to its final name, deleting any
* previously-existing init file.
*/
#if defined(WIN32) || defined(__CYGWIN__)
rename
(
tempfilename
,
finalfilename
);
LWLockRelease
(
RelCacheInitLock
);
#else
{
char
finalfilename_new
[
MAXPGPATH
];
snprintf
(
finalfilename_new
,
sizeof
(
finalfilename_new
),
"%s.new"
,
finalfilename
);
rename
(
tempfilename
,
finalfilename_new
);
LWLockRelease
(
RelCacheInitLock
);
/* Rename to active file after lock is released */
rename
(
finalfilename_new
,
finalfilename
);
}
#endif
}
else
{
...
...
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