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
c7ccc726
Commit
c7ccc726
authored
Sep 22, 2010
by
Dmitry Shulga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug#56821 - failure to start the MySQL Service.
parent
386d5047
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
16 deletions
+30
-16
sql/log.cc
sql/log.cc
+30
-16
No files found.
sql/log.cc
View file @
c7ccc726
...
...
@@ -5072,10 +5072,32 @@ extern "C" my_bool reopen_fstreams(const char *filename,
FILE
*
outstream
,
FILE
*
errstream
)
{
int
handle_fd
;
int
stream
_fd
;
int
err_fd
,
out
_fd
;
HANDLE
osfh
;
DBUG_ASSERT
(
filename
&&
(
outstream
||
errstream
));
DBUG_ASSERT
(
filename
&&
errstream
);
// Services don't have stdout/stderr on Windows, so _fileno returns -1.
err_fd
=
_fileno
(
errstream
);
if
(
err_fd
<
0
)
{
if
(
!
freopen
(
filename
,
"a+"
,
errstream
))
return
TRUE
;
setbuf
(
errstream
,
NULL
);
err_fd
=
_fileno
(
errstream
);
}
if
(
outstream
)
{
out_fd
=
_fileno
(
outstream
);
if
(
out_fd
<
0
)
{
if
(
!
freopen
(
filename
,
"a+"
,
outstream
))
return
TRUE
;
out_fd
=
_fileno
(
outstream
);
}
}
if
((
osfh
=
CreateFile
(
filename
,
GENERIC_READ
|
GENERIC_WRITE
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
|
...
...
@@ -5091,24 +5113,16 @@ extern "C" my_bool reopen_fstreams(const char *filename,
return
TRUE
;
}
if
(
outstream
)
if
(
_dup2
(
handle_fd
,
err_fd
)
<
0
)
{
stream_fd
=
_fileno
(
outstream
);
if
(
_dup2
(
handle_fd
,
stream_fd
)
<
0
)
{
CloseHandle
(
osfh
);
return
TRUE
;
}
CloseHandle
(
osfh
);
return
TRUE
;
}
if
(
errstream
)
if
(
outstream
&&
_dup2
(
handle_fd
,
out_fd
)
<
0
)
{
stream_fd
=
_fileno
(
errstream
);
if
(
_dup2
(
handle_fd
,
stream_fd
)
<
0
)
{
CloseHandle
(
osfh
);
return
TRUE
;
}
CloseHandle
(
osfh
);
return
TRUE
;
}
_close
(
handle_fd
);
...
...
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