Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
G
gdut-drcom
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
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
nanahira
gdut-drcom
Commits
0d9faf4f
Commit
0d9faf4f
authored
Dec 24, 2016
by
chenhaowen01
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: fgetpos error on windows
parent
5b50e038
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
3 deletions
+1
-3
src/logger.c
src/logger.c
+1
-3
No files found.
src/logger.c
View file @
0d9faf4f
...
@@ -28,7 +28,6 @@ void Logger_free(Logger *l)
...
@@ -28,7 +28,6 @@ void Logger_free(Logger *l)
void
log_add
(
Logger
*
l
,
int
level
,
const
char
*
msg
)
void
log_add
(
Logger
*
l
,
int
level
,
const
char
*
msg
)
{
{
static
fpos_t
pos
;
if
(
level
<
l
->
level
)
return
;
if
(
level
<
l
->
level
)
return
;
time_t
meow
=
time
(
NULL
);
time_t
meow
=
time
(
NULL
);
...
@@ -36,8 +35,7 @@ void log_add(Logger *l, int level, const char *msg)
...
@@ -36,8 +35,7 @@ void log_add(Logger *l, int level, const char *msg)
strftime
(
buf
,
sizeof
(
buf
),
l
->
datetime_format
,
localtime
(
&
meow
));
strftime
(
buf
,
sizeof
(
buf
),
l
->
datetime_format
,
localtime
(
&
meow
));
fgetpos
(
l
->
fp
,
&
pos
);
if
(
ftell
(
l
->
fp
)
>
LOGFILE_MAXSIZE
)
if
(
pos
.
__pos
>
LOGFILE_MAXSIZE
)
{
{
rewind
(
l
->
fp
);
rewind
(
l
->
fp
);
}
}
...
...
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