Skip to content

Commit

Permalink
port fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tanner0101 committed Feb 5, 2016
1 parent 84c51aa commit 9057d3d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Sources/Socket.swift
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,7 @@ public class Socket: Hashable, Equatable {

private class func htonsPort(port: in_port_t) -> in_port_t {
#if os(Linux)
let fixedPort = __bswap_16(port)
return fixedPort
return CFSwapUInt16(port)
#else
let isLittleEndian = Int(OSHostByteOrder()) == OSLittleEndian
return isLittleEndian ? _OSSwapInt16(port) : port
Expand Down

0 comments on commit 9057d3d

Please sign in to comment.