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
9ed99782
Commit
9ed99782
authored
Oct 14, 2003
by
heikki@hundin.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
os0file.c:
Fix Visual C++ compilation errors reported by Miguel
parent
d3827c1b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
45 deletions
+42
-45
innobase/os/os0file.c
innobase/os/os0file.c
+42
-45
No files found.
innobase/os/os0file.c
View file @
9ed99782
...
...
@@ -213,24 +213,27 @@ os_file_get_last_error(
if
(
report_all_errors
||
(
err
!=
ERROR_DISK_FULL
&&
err
!=
ERROR_FILE_EXISTS
))
{
ut_print_timestamp
(
stderr
);
fprintf
(
stderr
,
" InnoDB: Operating system error number %lu in a file operation.
\n
"
"InnoDB: See http://www.innodb.com/ibman.html for installation help.
\n
"
,
err
);
" InnoDB: Operating system error number %lu in a file operation.
\n
"
,
err
);
if
(
err
==
ERROR_PATH_NOT_FOUND
)
{
fprintf
(
stderr
,
"InnoDB: The error means the system cannot find the path specified.
\n
"
"InnoDB: In installation you must create directories yourself, InnoDB
\n
"
"InnoDB: does not create them.
\n
"
);
fprintf
(
stderr
,
"InnoDB: The error means the system cannot find the path specified.
\n
"
);
if
(
srv_is_being_started
)
{
fprintf
(
stderr
,
"InnoDB: If you are installing InnoDB, remember that you must create
\n
"
"InnoDB: directories yourself, InnoDB does not create them.
\n
"
);
}
}
else
if
(
err
==
ERROR_ACCESS_DENIED
)
{
fprintf
(
stderr
,
fprintf
(
stderr
,
"InnoDB: The error means mysqld does not have the access rights to
\n
"
"InnoDB: the directory. It may also be you have created a subdirectory
\n
"
"InnoDB: of the same name as a data file.
\n
"
);
}
else
{
fprintf
(
stderr
,
fprintf
(
stderr
,
"InnoDB: See section 13.2 at http://www.innodb.com/ibman.html
\n
"
"InnoDB: about operating system error numbers.
\n
"
);
}
...
...
@@ -252,29 +255,31 @@ os_file_get_last_error(
if
(
report_all_errors
||
(
err
!=
ENOSPC
&&
err
!=
EEXIST
))
{
ut_print_timestamp
(
stderr
);
ut_print_timestamp
(
stderr
);
fprintf
(
stderr
,
" InnoDB: Operating system error number %lu in a file operation.
\n
"
"InnoDB: See http://www.innodb.com/ibman.html for installation help.
\n
"
,
err
);
" InnoDB: Operating system error number %lu in a file operation.
\n
"
,
err
);
if
(
err
==
ENOENT
)
{
fprintf
(
stderr
,
"InnoDB: The error means the system cannot find the path specified.
\n
"
"InnoDB: In installation you must create directories yourself, InnoDB
\n
"
"InnoDB: does not create them.
\n
"
);
fprintf
(
stderr
,
"InnoDB: The error means the system cannot find the path specified.
\n
"
);
if
(
srv_is_being_started
)
{
fprintf
(
stderr
,
"InnoDB: If you are installing InnoDB, remember that you must create
\n
"
"InnoDB: directories yourself, InnoDB does not create them.
\n
"
);
}
}
else
if
(
err
==
EACCES
)
{
fprintf
(
stderr
,
fprintf
(
stderr
,
"InnoDB: The error means mysqld does not have the access rights to
\n
"
"InnoDB: the directory.
\n
"
);
}
else
{
if
(
strerror
((
int
)
err
)
!=
NULL
)
{
if
(
strerror
((
int
)
err
)
!=
NULL
)
{
fprintf
(
stderr
,
"InnoDB: Error number %lu means '%s'.
\n
"
,
err
,
strerror
((
int
)
err
));
}
}
fprintf
(
stderr
,
fprintf
(
stderr
,
"InnoDB: See also section 13.2 at http://www.innodb.com/ibman.html
\n
"
"InnoDB: about operating system error numbers.
\n
"
);
}
...
...
@@ -404,7 +409,7 @@ os_file_opendir(
ut_a
(
strlen
(
dirname
)
<
OS_FILE_MAX_PATH
);
strcpy
(
path
,
dirname
);
strcpy
(
path
+
strlen
(
path
),
"\
*
"
);
strcpy
(
path
+
strlen
(
path
),
"
\
\
"
);
/* Note that in Windows opening the 'directory stream' also retrieves
the first entry in the directory. Since it is '.', that is no problem,
...
...
@@ -493,18 +498,18 @@ os_file_readdir_next_file(
ret
=
FindNextFile
(
dir
,
lpFindFileData
);
if
(
ret
)
{
ut_a
(
strlen
(
lpFindFileData
->
cFile
n
ame
)
<
OS_FILE_MAX_PATH
);
ut_a
(
strlen
(
lpFindFileData
->
cFile
N
ame
)
<
OS_FILE_MAX_PATH
);
if
(
strcmp
(
lpFindFileData
->
cFile
n
ame
,
"."
)
==
0
||
strcmp
(
lpFindFileData
->
cFile
n
ame
,
".."
)
==
0
)
{
if
(
strcmp
(
lpFindFileData
->
cFile
N
ame
,
"."
)
==
0
||
strcmp
(
lpFindFileData
->
cFile
N
ame
,
".."
)
==
0
)
{
goto
next_file
;
}
strcpy
(
info
->
name
,
lpFindFileData
->
cFile
n
ame
);
strcpy
(
info
->
name
,
lpFindFileData
->
cFile
N
ame
);
info
->
size
=
(
ib_longlong
)(
buf
->
nFileSizeLow
)
+
(((
ib_longlong
)(
buf
->
nFileSizeHigh
))
<<
32
);
info
->
size
=
(
ib_longlong
)(
lpFindFileData
->
nFileSizeLow
)
+
(((
ib_longlong
)(
lpFindFileData
->
nFileSizeHigh
))
<<
32
);
if
(
lpFindFileData
->
dwFileAttributes
&
FILE_ATTRIBUTE_REPARSE_POINT
)
{
...
...
@@ -827,14 +832,13 @@ os_file_create(
DWORD
create_flag
;
DWORD
attributes
;
ibool
retry
;
try_again:
ut_a
(
name
);
if
(
create_mode
==
OS_FILE_OPEN_RAW
)
{
create_flag
=
OPEN_EXISTING
;
share_mode
=
FILE_SHARE_WRITE
;
if
(
create_mode
==
OS_FILE_OPEN
)
{
}
else
if
(
create_mode
==
OS_FILE_OPEN
)
{
create_flag
=
OPEN_EXISTING
;
}
else
if
(
create_mode
==
OS_FILE_CREATE
)
{
create_flag
=
CREATE_NEW
;
...
...
@@ -927,15 +931,12 @@ os_file_create(
if
(
create_mode
==
OS_FILE_OPEN
||
create_mode
==
OS_FILE_OPEN_RAW
)
{
mode_str
=
"OPEN"
;
create_flag
=
O_RDWR
;
}
else
if
(
create_mode
==
OS_FILE_CREATE
)
{
mode_str
=
"CREATE"
;
create_flag
=
O_RDWR
|
O_CREAT
|
O_EXCL
;
}
else
if
(
create_mode
==
OS_FILE_OVERWRITE
)
{
mode_str
=
"OVERWRITE"
;
create_flag
=
O_RDWR
|
O_CREAT
|
O_TRUNC
;
}
else
{
create_flag
=
0
;
...
...
@@ -1015,8 +1016,7 @@ os_file_delete(
char
*
name
)
/* in: file path as a null-terminated string */
{
#ifdef __WIN__
os_file_t
dummy
=
NULL
;
BOOL
ret
;
BOOL
ret
;
ret
=
DeleteFile
((
LPCTSTR
)
name
);
...
...
@@ -1024,17 +1024,16 @@ os_file_delete(
return
(
TRUE
);
}
os_file_handle_error
(
dummy
,
name
,
"delete"
);
os_file_handle_error
(
NULL
,
name
,
"delete"
);
return
(
FALSE
);
#else
os_file_t
dummy
=
0
;
int
ret
;
int
ret
;
ret
=
unlink
((
const
char
*
)
name
);
if
(
ret
!=
0
)
{
os_file_handle_error
(
dummy
,
name
,
"delete"
);
os_file_handle_error
(
0
,
name
,
"delete"
);
return
(
FALSE
);
}
...
...
@@ -1056,8 +1055,7 @@ os_file_rename(
char
*
newpath
)
/* in: new file path */
{
#ifdef __WIN__
os_file_t
dummy
=
NULL
;
BOOL
ret
;
BOOL
ret
;
ret
=
MoveFile
((
LPCTSTR
)
oldpath
,
(
LPCTSTR
)
newpath
);
...
...
@@ -1065,17 +1063,16 @@ os_file_rename(
return
(
TRUE
);
}
os_file_handle_error
(
dummy
,
oldpath
,
"delete"
);
os_file_handle_error
(
NULL
,
oldpath
,
"delete"
);
return
(
FALSE
);
#else
os_file_t
dummy
=
0
;
int
ret
;
int
ret
;
ret
=
rename
((
const
char
*
)
oldpath
,
(
const
char
*
)
newpath
);
if
(
ret
!=
0
)
{
os_file_handle_error
(
dummy
,
oldpath
,
"rename"
);
os_file_handle_error
(
0
,
oldpath
,
"rename"
);
return
(
FALSE
);
}
...
...
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