Skip to content

Commit

Permalink
fixes nanomsg#1131 (openindiana) compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
gdamore committed Jan 13, 2020
1 parent 4764225 commit b74e76c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/platform/posix/posix_ipclisten.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,13 @@ static int
ipc_remove_stale(const char *path)
{
int fd;
struct sockaddr_un sun;
struct sockaddr_un sa;
size_t sz;

sun.sun_family = AF_UNIX;
sz = sizeof(sun.sun_path);
sa.sun_family = AF_UNIX;
sz = sizeof(sa.sun_path);

if (nni_strlcpy(sun.sun_path, path, sz) >= sz) {
if (nni_strlcpy(sa.sun_path, path, sz) >= sz) {
return (NNG_EADDRINVAL);
}

Expand All @@ -203,7 +203,7 @@ ipc_remove_stale(const char *path)
// then the cleanup will fail. As this is supposed to be an
// exceptional case, don't worry.
(void) fcntl(fd, F_SETFL, O_NONBLOCK);
if (connect(fd, (void *) &sun, sizeof(sun)) < 0) {
if (connect(fd, (void *) &sa, sizeof(sa)) < 0) {
if (errno == ECONNREFUSED) {
(void) unlink(path);
}
Expand Down

0 comments on commit b74e76c

Please sign in to comment.