提交 df26e273 authored 作者: Michael Jerris's avatar Michael Jerris

fix for FSCORE-78. Write whole buffer of the pid into file with padded NULL's…

fix for FSCORE-78.  Write whole buffer of the pid into file with padded NULL's so that we don't leave leftovers behind from a crash.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6977 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 8ced480b
......@@ -443,9 +443,10 @@ int main(int argc, char *argv[])
pid = getpid();
memset(pid_buffer, 0, sizeof(pid_buffer));
switch_snprintf(pid_path, sizeof(pid_path), "%s%s%s", SWITCH_GLOBAL_dirs.log_dir, SWITCH_PATH_SEPARATOR, pfile);
switch_snprintf(pid_buffer, sizeof(pid_buffer), "%d", pid);
pid_len = strlen(pid_buffer);
pid_len = sizeof(pid_buffer);
apr_pool_create(&pool, NULL);
if (switch_file_open(&fd,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论