Skip to content

Commit

Permalink
implemented Zach's suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
Ptival committed Nov 4, 2012
1 parent 48febdb commit 763182a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compiler/kernel-template/client/msg.py-template
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ def init():
KCHAN = socket.fromfd(fd, socket.AF_UNIX, socket.SOCK_STREAM)

def recv_num():
h = struct.unpack('>B', KCHAN.recv(1))[0]
l = struct.unpack('>B', KCHAN.recv(1))[0]
return (h * 256 + l)
s = KCHAN.recv(2)
n = struct.unpack('>H', s)[0]
return n

def recv_str():
n = recv_num()
Expand Down

0 comments on commit 763182a

Please sign in to comment.