Skip to content
This repository has been archived by the owner on Jun 30, 2021. It is now read-only.

Commit

Permalink
fix build on SunOS
Browse files Browse the repository at this point in the history
  • Loading branch information
wiedi committed Oct 17, 2017
1 parent 17df36f commit 0c54892
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions evhtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -3884,7 +3884,7 @@ int
evhtp_bind_socket(evhtp_t * htp, const char * baddr, uint16_t port, int backlog)
{
#ifndef NO_SYS_UN
struct sockaddr_un sun = { 0 };
struct sockaddr_un sockun = { 0 };
#endif
struct sockaddr * sa;
struct sockaddr_in6 sin6 = { 0 };
Expand All @@ -3905,17 +3905,17 @@ evhtp_bind_socket(evhtp_t * htp, const char * baddr, uint16_t port, int backlog)
#ifndef NO_SYS_UN
baddr += 5;

if (strlen(baddr) >= sizeof(sun.sun_path))
if (strlen(baddr) >= sizeof(sockun.sun_path))
{
return -1;
}

sin_len = sizeof(struct sockaddr_un);
sun.sun_family = AF_UNIX;
sockun.sun_family = AF_UNIX;

strncpy(sun.sun_path, baddr, strlen(baddr));
strncpy(sockun.sun_path, baddr, strlen(baddr));

sa = (struct sockaddr *)&sun;
sa = (struct sockaddr *)&sockun;
#else

return -1;
Expand Down

0 comments on commit 0c54892

Please sign in to comment.