diff options
author | jcid <devnull@localhost> | 2008-11-05 19:11:02 +0100 |
---|---|---|
committer | jcid <devnull@localhost> | 2008-11-05 19:11:02 +0100 |
commit | 8d11ae65472e4a9c70476f9b165df7a114d06908 (patch) | |
tree | cfd63c085c4eee16b250ecbaaa61b9d53ff4b6aa /src/IO/dpi.c | |
parent | 26fe2d4e6d93618c44c3ab35089f9d35eec5389b (diff) |
- Cleaned up and normalized D_SUN_LEN usage.
Diffstat (limited to 'src/IO/dpi.c')
-rw-r--r-- | src/IO/dpi.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/IO/dpi.c b/src/IO/dpi.c index 7c4357da..01d3a5b5 100644 --- a/src/IO/dpi.c +++ b/src/IO/dpi.c @@ -353,7 +353,7 @@ static int Dpi_check_uds(char *uds_name) strncpy(pun.sun_path, uds_name, sizeof (pun.sun_path)); if ((SockFD = socket(AF_LOCAL, SOCK_STREAM, 0)) == -1 || - connect(SockFD, (void*)&pun, D_SUN_LEN(&pun)) == -1) { + connect(SockFD, (struct sockaddr *) &pun, D_SUN_LEN(&pun)) == -1) { MSG("Dpi_check_uds: %s %s\n", dStrerror(errno), uds_name); } else { Dpi_close_fd(SockFD); @@ -497,7 +497,7 @@ static char *Dpi_get_server_uds_name(const char *server_name) _MSG("dpid_uds_name = [%s]\n", dpid_uds_name); strncpy(dpid.sun_path, dpid_uds_name, sizeof(dpid.sun_path)); - if (connect(sock, (struct sockaddr *) &dpid, sizeof(dpid)) == -1) + if (connect(sock, (struct sockaddr *) &dpid, D_SUN_LEN(&dpid)) == -1) perror("connect"); /* ask dpid to check the server plugin and send its UDS name back */ request = a_Dpip_build_cmd("cmd=%s msg=%s", "check_server", server_name); @@ -717,7 +717,6 @@ void a_Dpi_bye_dpid() srs_name = Dpi_get_dpid_uds_name(); sun_path_len = sizeof(sa.sun_path); - addr_len = sizeof(sa); sa.sun_family = AF_LOCAL; @@ -725,6 +724,7 @@ void a_Dpi_bye_dpid() MSG("a_Dpi_bye_dpid: %s\n", dStrerror(errno)); } strncpy(sa.sun_path, srs_name, sizeof (sa.sun_path)); + addr_len = D_SUN_LEN(&sa); if (connect(new_socket, (struct sockaddr *) &sa, addr_len) == -1) { MSG("a_Dpi_bye_dpid: %s\n", dStrerror(errno)); MSG("%s\n", sa.sun_path); |