Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
cfd26f53
Commit
cfd26f53
authored
Mar 25, 2015
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fs/io/FileOutputStream: fix wrong #ifdef WIN32
parent
69ad5671
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
23 deletions
+3
-23
FileOutputStream.cxx
src/fs/io/FileOutputStream.cxx
+3
-23
No files found.
src/fs/io/FileOutputStream.cxx
View file @
cfd26f53
...
@@ -214,32 +214,16 @@ FileOutputStream::Cancel()
...
@@ -214,32 +214,16 @@ FileOutputStream::Cancel()
RemoveFile
(
GetPath
());
RemoveFile
(
GetPath
());
}
}
#ifdef WIN32
#endif
FileOutputStream
::
FileOutputStream
(
Path
_path
,
Error
&
error
)
:
path
(
_path
),
handle
(
CreateFile
(
path
.
c_str
(),
GENERIC_WRITE
,
0
,
nullptr
,
CREATE_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
|
FILE_FLAG_WRITE_THROUGH
,
nullptr
))
{
if
(
handle
==
INVALID_HANDLE_VALUE
)
{
const
auto
path_utf8
=
path
.
ToUTF8
();
error
.
FormatLastError
(
"Failed to create %s"
,
path_utf8
.
c_str
());
}
}
#else
AppendFileOutputStream
::
AppendFileOutputStream
(
Path
_path
,
Error
&
error
)
AppendFileOutputStream
::
AppendFileOutputStream
(
Path
_path
,
Error
&
error
)
:
BaseFileOutputStream
(
_path
)
:
BaseFileOutputStream
(
_path
)
{
{
#ifdef WIN32
#ifdef WIN32
SetHandle
(
CreateFile
(
path
.
c_str
(),
GENERIC_WRITE
,
0
,
nullptr
,
SetHandle
(
CreateFile
(
GetPath
()
.
c_str
(),
GENERIC_WRITE
,
0
,
nullptr
,
OPEN_EXISTING
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
|
FILE_FLAG_WRITE_THROUGH
,
FILE_ATTRIBUTE_NORMAL
|
FILE_FLAG_WRITE_THROUGH
,
nullptr
))
nullptr
))
;
if
(
!
IsDefined
())
if
(
!
IsDefined
())
error
.
FormatLastError
(
"Failed to append to %s"
,
error
.
FormatLastError
(
"Failed to append to %s"
,
GetPath
().
ToUTF8
().
c_str
());
GetPath
().
ToUTF8
().
c_str
());
...
@@ -257,8 +241,6 @@ AppendFileOutputStream::AppendFileOutputStream(Path _path, Error &error)
...
@@ -257,8 +241,6 @@ AppendFileOutputStream::AppendFileOutputStream(Path _path, Error &error)
#endif
#endif
}
}
#endif
bool
bool
AppendFileOutputStream
::
Commit
(
gcc_unused
Error
&
error
)
AppendFileOutputStream
::
Commit
(
gcc_unused
Error
&
error
)
{
{
...
@@ -274,5 +256,3 @@ AppendFileOutputStream::Commit(gcc_unused Error &error)
...
@@ -274,5 +256,3 @@ AppendFileOutputStream::Commit(gcc_unused Error &error)
return
success
;
return
success
;
#endif
#endif
}
}
#endif
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