mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-13 20:50:41 +00:00
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
This commit is contained in:
parent
8ced480b11
commit
df26e27377
@ -443,9 +443,10 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
pid = getpid();
|
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_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);
|
switch_snprintf(pid_buffer, sizeof(pid_buffer), "%d", pid);
|
||||||
pid_len = strlen(pid_buffer);
|
pid_len = sizeof(pid_buffer);
|
||||||
|
|
||||||
apr_pool_create(&pool, NULL);
|
apr_pool_create(&pool, NULL);
|
||||||
if (switch_file_open(&fd,
|
if (switch_file_open(&fd,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user