Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
阿啄debugIT
libfastcommon
提交
0fd3425f
L
libfastcommon
项目概览
阿啄debugIT
/
libfastcommon
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
libfastcommon
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0fd3425f
编写于
5月 15, 2015
作者:
Y
yuqing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
bug fixed: log header correctly when rotate
上级
8b9bdfd3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
7 addition
and
6 deletion
+7
-6
HISTORY
HISTORY
+1
-0
src/logger.c
src/logger.c
+6
-6
未找到文件。
HISTORY
浏览文件 @
0fd3425f
...
...
@@ -5,6 +5,7 @@ Version 1.14 2015-05-15
* bugfixed: sockopt.c correct fsbytes to sbytes in FreeBSD
* macro FDFS_WRITE_BUFF_SIZE change to FAST_WRITE_BUFF_SIZE
* logger.c call log_check_rotate in lock
* bug fixed: log header correctly when rotate
Version 1.13 2015-02-27
* support php extension
...
...
src/logger.c
浏览文件 @
0fd3425f
...
...
@@ -567,9 +567,9 @@ static int log_fsync(LogContext *pContext, const bool bNeedLock)
int
result
;
int
lock_res
;
int
write_bytes
;
int
written
;
write_bytes
=
pContext
->
pcurrent_buff
-
pContext
->
log_buff
;
if
(
write_bytes
==
0
)
if
(
pContext
->
pcurrent_buff
-
pContext
->
log_buff
==
0
)
{
if
(
!
pContext
->
rotate_immediately
)
{
...
...
@@ -599,6 +599,7 @@ static int log_fsync(LogContext *pContext, const bool bNeedLock)
__LINE__
,
lock_res
,
STRERROR
(
lock_res
));
}
write_bytes
=
pContext
->
pcurrent_buff
-
pContext
->
log_buff
;
pContext
->
current_size
+=
write_bytes
;
if
(
pContext
->
rotate_size
>
0
)
{
...
...
@@ -612,9 +613,9 @@ static int log_fsync(LogContext *pContext, const bool bNeedLock)
result
=
0
;
do
{
write_bytes
=
pContext
->
pcurrent_buff
-
pContext
->
log_buff
;
if
(
write
(
pContext
->
log_fd
,
pContext
->
log_buff
,
write_bytes
)
!=
\
write_bytes
)
written
=
write
(
pContext
->
log_fd
,
pContext
->
log_buff
,
write_bytes
)
;
pContext
->
pcurrent_buff
=
pContext
->
log_buff
;
if
(
written
!=
write_bytes
)
{
result
=
errno
!=
0
?
errno
:
EIO
;
fprintf
(
stderr
,
"file: "
__FILE__
", line: %d, "
\
...
...
@@ -629,7 +630,6 @@ static int log_fsync(LogContext *pContext, const bool bNeedLock)
}
}
while
(
0
);
pContext
->
pcurrent_buff
=
pContext
->
log_buff
;
if
(
bNeedLock
&&
((
lock_res
=
pthread_mutex_unlock
(
\
&
(
pContext
->
log_thread_lock
)))
!=
0
))
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录