Fix variable shadowing
[fio.git] / server.c
index 15dc2c4b38ba3e01682cf85401458caa2d0421d4..7e7ffedc7139077a6ea5b86b5e181afb0dd8efb0 100644 (file)
--- a/server.c
+++ b/server.c
@@ -1199,7 +1199,6 @@ static int handle_connection(struct sk_out *sk_out)
                        .events = POLLIN,
                };
 
-               ret = 0;
                do {
                        int timeout = 1000;
 
@@ -1359,7 +1358,7 @@ static int accept_loop(int listen_sk)
 
                dprint(FD_NET, "server: connect from %s\n", from);
 
-               sk_out = smalloc(sizeof(*sk_out));
+               sk_out = scalloc(1, sizeof(*sk_out));
                if (!sk_out) {
                        close(sk);
                        return -1;
@@ -1595,7 +1594,7 @@ void fio_server_send_gs(struct group_run_stats *rs)
 }
 
 void fio_server_send_job_options(struct flist_head *opt_list,
-                                unsigned int groupid)
+                                unsigned int gid)
 {
        struct cmd_job_option pdu;
        struct flist_head *entry;
@@ -1610,12 +1609,12 @@ void fio_server_send_job_options(struct flist_head *opt_list,
                p = flist_entry(entry, struct print_option, list);
                memset(&pdu, 0, sizeof(pdu));
 
-               if (groupid == -1U) {
+               if (gid == -1U) {
                        pdu.global = __cpu_to_le16(1);
                        pdu.groupid = 0;
                } else {
                        pdu.global = 0;
-                       pdu.groupid = cpu_to_le32(groupid);
+                       pdu.groupid = cpu_to_le32(gid);
                }
                len = strlen(p->name);
                if (len >= sizeof(pdu.name)) {
@@ -2145,14 +2144,14 @@ static int fio_init_server_ip(void)
 #endif
 
        if (use_ipv6) {
-               const void *src = &saddr_in6.sin6_addr;
+               void *src = &saddr_in6.sin6_addr;
 
                addr = (struct sockaddr *) &saddr_in6;
                socklen = sizeof(saddr_in6);
                saddr_in6.sin6_family = AF_INET6;
                str = inet_ntop(AF_INET6, src, buf, sizeof(buf));
        } else {
-               const void *src = &saddr_in.sin_addr;
+               void *src = &saddr_in.sin_addr;
 
                addr = (struct sockaddr *) &saddr_in;
                socklen = sizeof(saddr_in);
@@ -2220,7 +2219,7 @@ static int fio_init_server_connection(void)
 
        if (!bind_sock) {
                char *p, port[16];
-               const void *src;
+               void *src;
                int af;
 
                if (use_ipv6) {