Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fmt
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
Libraries
fmt
Commits
2dad1690
Commit
2dad1690
authored
Aug 28, 2014
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix BufferefFile test on Windows.
parent
564da259
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
10 deletions
+9
-10
posix.cc
posix.cc
+3
-7
posix.h
posix.h
+6
-3
No files found.
posix.cc
View file @
2dad1690
...
...
@@ -71,13 +71,9 @@ fmt::BufferedFile::~BufferedFile() FMT_NOEXCEPT(true) {
}
fmt
::
BufferedFile
::
BufferedFile
(
fmt
::
StringRef
filename
,
fmt
::
StringRef
mode
)
{
for
(;;)
{
file_
=
FMT_SYSTEM
(
fopen
(
filename
.
c_str
(),
mode
.
c_str
()));
if
(
file_
)
return
;
if
(
errno
!=
EINTR
)
throw
SystemError
(
errno
,
"cannot open file"
);
}
FMT_RETRY_VAL
(
file_
,
FMT_SYSTEM
(
fopen
(
filename
.
c_str
(),
mode
.
c_str
())),
0
);
if
(
!
file_
)
throw
SystemError
(
errno
,
"cannot open file"
);
}
void
fmt
::
BufferedFile
::
close
()
{
...
...
posix.h
View file @
2dad1690
...
...
@@ -63,16 +63,19 @@
# endif
#endif
// Retries the expression while it evaluates to -1 and error equals to EINTR.
// Retries the expression while it evaluates to error_result and errno
// equals to EINTR.
#ifndef _WIN32
# define FMT_RETRY
(result, expression
) \
# define FMT_RETRY
_VAL(result, expression, error_result
) \
do { \
result = (expression); \
} while (result ==
-1
&& errno == EINTR)
} while (result ==
error_result
&& errno == EINTR)
#else
# define FMT_RETRY(result, expression) result = (expression)
#endif
#define FMT_RETRY(result, expression) FMT_RETRY_VAL(result, expression, -1)
namespace
fmt
{
// An error code.
...
...
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