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
6d1ae0c9
Commit
6d1ae0c9
authored
Jul 05, 2000
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix typo (extraneous semicolon) in fd.c patch to avoid excess seeks.
Now it skips useless SEEK_CUR 0 calls too, as intended.
parent
98fe6703
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
9 deletions
+17
-9
src/backend/storage/file/fd.c
src/backend/storage/file/fd.c
+17
-9
No files found.
src/backend/storage/file/fd.c
View file @
6d1ae0c9
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/file/fd.c,v 1.6
1 2000/06/15 04:10:00 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/file/fd.c,v 1.6
2 2000/07/05 21:10:05 tgl
Exp $
*
* NOTES:
*
...
...
@@ -809,11 +809,13 @@ FileWrite(File file, char *buffer, int amount)
FileAccess
(
file
);
returnCode
=
write
(
VfdCache
[
file
].
fd
,
buffer
,
amount
);
if
(
returnCode
>
0
)
{
if
(
returnCode
>
0
)
{
VfdCache
[
file
].
seekPos
+=
returnCode
;
/* mark the file as needing fsync */
VfdCache
[
file
].
fdstate
|=
FD_DIRTY
;
}
else
}
else
VfdCache
[
file
].
seekPos
=
FileUnknownPos
;
return
returnCode
;
...
...
@@ -832,6 +834,8 @@ FileSeek(File file, long offset, int whence)
switch
(
whence
)
{
case
SEEK_SET
:
if
(
offset
<
0
)
elog
(
ERROR
,
"FileSeek: invalid offset: %ld"
,
offset
);
VfdCache
[
file
].
seekPos
=
offset
;
break
;
case
SEEK_CUR
:
...
...
@@ -845,8 +849,11 @@ FileSeek(File file, long offset, int whence)
elog
(
ERROR
,
"FileSeek: invalid whence: %d"
,
whence
);
break
;
}
}
else
switch
(
whence
)
{
}
else
{
switch
(
whence
)
{
case
SEEK_SET
:
if
(
offset
<
0
)
elog
(
ERROR
,
"FileSeek: invalid offset: %ld"
,
offset
);
...
...
@@ -854,7 +861,7 @@ FileSeek(File file, long offset, int whence)
VfdCache
[
file
].
seekPos
=
lseek
(
VfdCache
[
file
].
fd
,
offset
,
whence
);
break
;
case
SEEK_CUR
:
if
(
(
offset
!=
0
)
||
(
VfdCache
[
file
].
seekPos
==
FileUnknownPos
));
if
(
offset
!=
0
||
VfdCache
[
file
].
seekPos
==
FileUnknownPos
)
VfdCache
[
file
].
seekPos
=
lseek
(
VfdCache
[
file
].
fd
,
offset
,
whence
);
break
;
case
SEEK_END
:
...
...
@@ -864,6 +871,7 @@ FileSeek(File file, long offset, int whence)
elog
(
ERROR
,
"FileSeek: invalid whence: %d"
,
whence
);
break
;
}
}
return
VfdCache
[
file
].
seekPos
;
}
...
...
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