Skip to content

Commit

Permalink
Amend UnixAddress to use the AddressFamily enum instead of directly u…
Browse files Browse the repository at this point in the history
…sing AF_UNIX, to be consistent with InternetAddress.
  • Loading branch information
Imagix committed May 30, 2015
1 parent 8812a88 commit 4390b78
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions std/socket.d
Expand Up @@ -1999,7 +1999,7 @@ static if (is(sockaddr_un))

this() pure nothrow @nogc
{
sun.sun_family = AF_UNIX;
sun.sun_family = AddressFamily.UNIX;
sun.sun_path = '?';
}

Expand All @@ -2023,14 +2023,14 @@ static if (is(sockaddr_un))
this(in char[] path) @trusted pure
{
enforce(path.length <= sun.sun_path.sizeof, new SocketParameterException("Path too long"));
sun.sun_family = AF_UNIX;
sun.sun_family = AddressFamily.UNIX;
sun.sun_path.ptr[0..path.length] = (cast(byte[]) path)[];
sun.sun_path.ptr[path.length] = 0;
}

this(sockaddr_un addr) pure nothrow @nogc
{
assert(addr.sun_family == AF_UNIX);
assert(addr.sun_family == AddressFamily.UNIX);
sun = addr;
}

Expand Down

0 comments on commit 4390b78

Please sign in to comment.