diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-01-23 22:05:07 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-02-05 12:59:42 +0100 |
commit | 2b7562abbb9aad20214387492b8f4f2d089c6738 (patch) | |
tree | 77eef0af184bc0843f3dc673bd3671cd2dd8ac3d | |
parent | 89d2c5ed7a054bc05a21209d5a9c79ad7151f8f7 (diff) |
uapi: Simpler function signature
-rw-r--r-- | uapi.go | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -28,7 +28,7 @@ func (s *IPCError) ErrorCode() int64 { return s.int64 } -func ipcGetOperation(device *Device, socket *bufio.ReadWriter) *IPCError { +func ipcGetOperation(device *Device, socket *bufio.Writer) *IPCError { device.log.Debug.Println("UAPI: Processing get operation") @@ -108,7 +108,7 @@ func ipcGetOperation(device *Device, socket *bufio.ReadWriter) *IPCError { return nil } -func ipcSetOperation(device *Device, socket *bufio.ReadWriter) *IPCError { +func ipcSetOperation(device *Device, socket *bufio.Reader) *IPCError { scanner := bufio.NewScanner(socket) logError := device.log.Error logDebug := device.log.Debug @@ -403,11 +403,11 @@ func ipcHandle(device *Device, socket net.Conn) { switch op { case "set=1\n": device.log.Debug.Println("UAPI: Set operation") - status = ipcSetOperation(device, buffered) + status = ipcSetOperation(device, buffered.Reader) case "get=1\n": device.log.Debug.Println("UAPI: Get operation") - status = ipcGetOperation(device, buffered) + status = ipcGetOperation(device, buffered.Writer) default: device.log.Error.Println("Invalid UAPI operation:", op) |