Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
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
nexedi
MariaDB
Commits
a804f28c
Commit
a804f28c
authored
Mar 28, 2013
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Fixing Linux index compile errors
modified: storage/connect/xindex.cpp
parent
0dc6f5aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
storage/connect/xindex.cpp
storage/connect/xindex.cpp
+9
-10
No files found.
storage/connect/xindex.cpp
View file @
a804f28c
...
...
@@ -2389,7 +2389,6 @@ void *XFILE::FileView(PGLOBAL g, char *fn, int loff, int hoff, int size)
/***********************************************************************/
bool
XHUGE
::
Open
(
PGLOBAL
g
,
char
*
filename
,
int
id
,
MODE
mode
)
{
DWORD
drc
,
rc
;
IOFF
noff
[
MAX_INDX
];
if
(
Hfile
!=
INVALID_HANDLE_VALUE
)
{
...
...
@@ -2403,8 +2402,8 @@ bool XHUGE::Open(PGLOBAL g, char *filename, int id, MODE mode)
#if defined(WIN32)
LONG
high
=
0
;
DWORD
access
,
share
,
creation
;
DWORD
rc
,
drc
,
access
,
share
,
creation
;
/*********************************************************************/
/* Create the file object according to access mode */
/*********************************************************************/
...
...
@@ -2534,7 +2533,7 @@ bool XHUGE::Open(PGLOBAL g, char *filename, int id, MODE mode)
/*******************************************************************/
/* Position the cursor at end of file so ftell returns file size. */
/*******************************************************************/
if
(
!
(
Offset
.
Val
=
(
longlong
)
lseek64
(
Hfile
,
0LL
,
SEEK_END
)))
{
if
(
!
(
NewOff
.
Val
=
(
longlong
)
lseek64
(
Hfile
,
0LL
,
SEEK_END
)))
{
sprintf
(
g
->
Message
,
MSG
(
FUNC_ERRNO
),
errno
,
"Seek"
);
return
true
;
}
// endif
...
...
@@ -2543,8 +2542,7 @@ bool XHUGE::Open(PGLOBAL g, char *filename, int id, MODE mode)
if
(
id
>=
0
)
{
// New not sep index file. Write the header.
memset
(
noff
,
0
,
sizeof
(
noff
));
Write
(
g
,
noff
,
sizeof
(
IOFF
),
MAX_INDX
,
rc
);
Offset
.
Val
=
(
longlong
)(
sizeof
(
IOFF
)
*
MAX_INDX
);
NewOff
.
Low
=
write
(
Hfile
,
&
noff
,
sizeof
(
noff
));
}
// endif id
}
else
if
(
mode
==
MODE_READ
&&
id
>=
0
)
{
...
...
@@ -2733,21 +2731,22 @@ void XHUGE::Close(char *fn, int id)
CloseFileHandle
(
Hfile
);
Hfile
=
CreateFile
(
fn
,
GENERIC_READ
|
GENERIC_WRITE
,
0
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
Hfile
!=
INVALID_HANDLE_VALUE
)
if
(
SetFilePointer
(
Hfile
,
id
*
sizeof
(
IOFF
),
NULL
,
FILE_BEGIN
)
!=
INVALID_SET_FILE_POINTER
)
{
DWORD
nbw
;
WriteFile
(
Hfile
,
&
NewOff
,
sizeof
(
longlong
),
&
nbw
,
NULL
);
// WriteFile(Hfile, &Newhigh, sizeof(int), &nbw, NULL);
WriteFile
(
Hfile
,
&
NewOff
,
sizeof
(
IOFF
),
&
nbw
,
NULL
);
}
// endif SetFilePointer
}
// endif id
#else // !WIN32
if
(
id
>=
0
&&
fn
)
{
fnctl
(
Hfile
,
F_SETFD
,
O_WRONLY
);
fcntl
(
Hfile
,
F_SETFD
,
O_WRONLY
);
if
(
lseek
(
Hfile
,
id
*
sizeof
(
IOFF
),
SEEK_SET
))
write
(
Hfile
,
&
noff
[
id
]
,
sizeof
(
IOFF
));
write
(
Hfile
,
&
NewOff
,
sizeof
(
IOFF
));
}
// endif id
#endif // !WIN32
...
...
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