From 49cab699e9f151eeb870ab93d14642425e824c19 Mon Sep 17 00:00:00 2001 From: Bill Abt Date: Tue, 27 Aug 2019 10:18:21 -0400 Subject: [PATCH] Minor format changes and adding of additional comments. --- Sources/Socket/Socket.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/Socket/Socket.swift b/Sources/Socket/Socket.swift index 5b70b01..387886f 100644 --- a/Sources/Socket/Socket.swift +++ b/Sources/Socket/Socket.swift @@ -690,9 +690,10 @@ public class Socket: SocketReader, SocketWriter { var memLoc = 0 // macOS uses one byte for sa_family_t, Linux uses two... + // Note: on Linux, account for endianess... #if os(Linux) let afUnixShort = UInt16(AF_UNIX) - if isLittleEndian { + if isLittleEndian { addrPtr[memLoc] = UInt8(afUnixShort & 0xFF) memLoc += 1 addrPtr[memLoc] = UInt8((afUnixShort >> 8) & 0xFF)