MOD aaa-12 删除多余临时变量 SOL 删除多余临时变量 修改人:zhangliang 检视人:zhangliang

This commit is contained in:
zhanglianghy 2019-09-06 09:25:53 +08:00
parent 57cf457c77
commit 753ebc0208
3 changed files with 11 additions and 18 deletions

View File

@ -212,7 +212,6 @@ ret_code br_save_file(BR_EVENT_TYPE event_type,
char *key_str = "bridge_ports";
char iface_str[IF_BUFF_LEN] = {0};
char config_str[IF_BUFF_LEN] = {0};
ret_code ret;
switch(event_type)
{
@ -715,10 +714,10 @@ ret_code br_if_config_chk(uint source,uint *config_type,
memset(input, 0, *input_len);
strncpy(input, br_config.br_name, BR_NAMSIZ - 1);
input += BR_NAMSIZ;
input = (char *)input + BR_NAMSIZ;
*(int *)input = br_config.port_num;
input += sizeof(int);
input = (char *)input + sizeof(int);;
for(i = 0; i < br_config.port_num; i++)
{
@ -754,10 +753,10 @@ ret_code br_if_config_proc(uint source, uint config_type,
int err = 0;
br_name = input;
input += BR_NAMSIZ;
input = (char *)input + BR_NAMSIZ;;
port_num = (int *)input;
input += sizeof(int);
input = (char *)input + sizeof(int);
port_list = input;
@ -1015,7 +1014,6 @@ ret_code br_each_fdb_to_json_string(cJSON *json_array, fdb_info_t *fdb_info)
int br_fdb_to_json_string(br_fdb_status_t *fdb_status, char *output)
{
cJSON *fdb_array;
char *json_str;
int i;
s2j_create_json_obj(br_obj);

View File

@ -174,7 +174,6 @@ ret_code ip_config_format_json(ip_config_t *config_buff,
{
ip_config_string_t tem_buff = {0};
ip_config_string_t *ip_config = &tem_buff;
char *json_ip;
ip_config->family = AF_INET;
ip_config->prefixlen = config_buff->prefixlen;
@ -274,12 +273,10 @@ ret_code if_set_prefix(ip_config_t *ip_conf, int *code)
ret_code if_get_prefix(ip_config_t *ip_conf, int *code)
{
struct sockaddr_in *addr;
struct ifreq netmask;
struct sockaddr_in *addr;
struct ifreq ifreq;
ret_code ret = RET_OK;
int mask_ret;
int i;
if(ip_conf->family != AF_INET)
{
@ -315,13 +312,10 @@ ret_code if_get_prefix(ip_config_t *ip_conf, int *code)
ret_code if_get_prefix_all(pointer output, int *output_len, int *code)
{
struct ifreq ifreq[MAX_IF_NUM];
struct sockaddr_in *addr;
struct ifreq netmask;
ip_config_t *ip_conf;
struct ifconf ifc;
int if_count = 0;
ret_code ret;
int mask_ret;
int i;
memset(ifreq, 0, MAX_IF_NUM * sizeof(struct ifreq));
@ -495,8 +489,7 @@ ret_code ip_config_proc(uint source, uint config_type,
pointer output, int *output_len)
{
uint conf_type = config_type;
ip_config_t conf_buff = {0};
ip_config_t *ip_conf = &conf_buff;
ip_config_t *ip_conf;
ret_code ret = RET_OK;
int code;
@ -529,7 +522,7 @@ ret_code ip_config_get(uint source,
{
ip_config_t *ip_conf;
ret_code ret = RET_OK;
int code, conf_type;
int code;
ip_conf = (ip_config_t *)input;

View File

@ -168,13 +168,15 @@ boolean rpc_unix_sockets_get(int port, int *psfd)
if (bind(listenfd, (struct sockaddr *)&serun, size) < 0)
{
rpc_log_error("bind error\n");
rpc_log_error("bind error\n");
close(listenfd);
return FALSE;
}
if (listen(listenfd, BACKLOG) < 0)
{
rpc_log_error("listen error\n");
rpc_log_error("listen error\n");
close(listenfd);
return FALSE;
}