提交 0412ae8e authored 作者: Stefan Knoblich's avatar Stefan Knoblich

snprintf needs a format string too, and write has the warn_unused_result…

snprintf needs a format string too, and write has the warn_unused_result attribute set, so store the return value somewhere

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13090 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 cfab5f61
......@@ -58,7 +58,7 @@ void ei_link(listener_t *listener, erlang_pid *from, erlang_pid *to) {
char msgbuf[2048];
char *s;
int index = 0;
/*int n;*/
int ret;
index = 5; /* max sizes: */
ei_encode_version(msgbuf,&index); /* 1 */
......@@ -74,7 +74,7 @@ void ei_link(listener_t *listener, erlang_pid *from, erlang_pid *to) {
/* sum: 542 */
switch_mutex_lock(listener->sock_mutex);
write(listener->sockfd, msgbuf, index);
ret = write(listener->sockfd, msgbuf, index);
switch_mutex_unlock(listener->sock_mutex);
}
......@@ -190,7 +190,7 @@ int ei_spawn(struct ei_cnode_s *ec, int sockfd, erlang_ref *ref, char *module, c
void ei_init_ref(ei_cnode *ec, erlang_ref *ref)
{
memset(ref, 0, sizeof(*ref)); /* zero out the struct */
snprintf(ref->node, MAXATOMLEN, ec->thisnodename);
snprintf(ref->node, MAXATOMLEN, "%s", ec->thisnodename);
switch_mutex_lock(globals.ref_mutex);
globals.reference0++;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论