Lines Matching refs:rc

92 	int rc;  in node_get()  local
104 rc = map_create(&node->services); in node_get()
105 if (rc) in node_get()
108 rc = map_put(&nodes, hash_u32(node_id), &node->mi); in node_get()
109 if (rc) { in node_get()
160 int rc; in service_announce_new() local
171 rc = sendto(ctx->sock, &cmsg, sizeof(cmsg), 0, in service_announce_new()
173 if (rc < 0) in service_announce_new()
176 return rc; in service_announce_new()
184 int rc; in service_announce_del() local
195 rc = sendto(ctx->sock, &cmsg, sizeof(cmsg), 0, in service_announce_del()
197 if (rc < 0) in service_announce_del()
200 return rc; in service_announce_del()
207 int rc; in lookup_notify() local
217 rc = sendto(ctx->sock, &pkt, sizeof(pkt), 0, in lookup_notify()
219 if (rc < 0) in lookup_notify()
221 return rc; in lookup_notify()
229 int rc; in annouce_servers() local
238 rc = service_announce_new(ctx, sq, srv); in annouce_servers()
239 if (rc < 0) in annouce_servers()
240 return rc; in annouce_servers()
252 int rc; in server_add() local
270 rc = map_reput(&node->services, hash_u32(port), &srv->mi, &mi); in server_add()
271 if (rc) in server_add()
326 int rc; in ctrl_cmd_hello() local
328 rc = sendto(ctx->sock, buf, len, 0, (void *)sq, sizeof(*sq)); in ctrl_cmd_hello()
329 if (rc > 0) in ctrl_cmd_hello()
330 rc = annouce_servers(ctx, sq); in ctrl_cmd_hello()
332 return rc; in ctrl_cmd_hello()
343 int rc; in ctrl_cmd_bye() local
371 rc = sendto(ctx->sock, &pkt, sizeof(pkt), 0, in ctrl_cmd_bye()
373 if (rc < 0) in ctrl_cmd_bye()
392 int rc; in ctrl_cmd_del_client() local
435 rc = sendto(ctx->sock, &pkt, sizeof(pkt), 0, in ctrl_cmd_del_client()
437 if (rc < 0) in ctrl_cmd_del_client()
451 int rc = 0; in ctrl_cmd_new_server() local
468 rc = service_announce_new(ctx, &ctx->bcast_sq, srv); in ctrl_cmd_new_server()
480 return rc; in ctrl_cmd_new_server()
584 int rc; in ctrl_port_fn() local
607 rc = 0; in ctrl_port_fn()
610 rc = ctrl_cmd_hello(ctx, &sq, buf, len); in ctrl_port_fn()
613 rc = ctrl_cmd_bye(ctx, &sq); in ctrl_port_fn()
616 rc = ctrl_cmd_del_client(ctx, &sq, in ctrl_port_fn()
621 rc = ctrl_cmd_new_server(ctx, &sq, in ctrl_port_fn()
628 rc = ctrl_cmd_del_server(ctx, &sq, in ctrl_port_fn()
639 rc = ctrl_cmd_new_lookup(ctx, &sq, in ctrl_port_fn()
644 rc = ctrl_cmd_del_lookup(ctx, &sq, in ctrl_port_fn()
650 if (rc < 0) in ctrl_port_fn()
660 int rc; in say_hello() local
665 rc = sendto(ctx->sock, &pkt, sizeof(pkt), 0, in say_hello()
667 if (rc < 0) in say_hello()
668 return rc; in say_hello()
715 int rc; in main() local
756 rc = map_create(&nodes); in main()
757 if (rc) in main()
764 rc = getsockname(ctx.sock, (void*)&sq, &sl); in main()
765 if (rc < 0) in main()
770 rc = bind(ctx.sock, (void *)&sq, sizeof(sq)); in main()
771 if (rc < 0) { in main()
784 rc = say_hello(&ctx); in main()
785 if (rc) in main()