diff options
author | Filipe Laíns <lains@riseup.net> | 2021-02-25 16:11:45 +0000 |
---|---|---|
committer | Filipe Laíns <lains@riseup.net> | 2021-02-25 16:15:55 +0000 |
commit | cb003cc4793edb14f1d93dfa2e8f3b0ffecd72b1 (patch) | |
tree | 482e540e43d4a8993d98a7f24efb36a198af7cc8 /ioctl/hidraw.py | |
parent | b2e952baeee2fcf7881019fda049c75015c77c67 (diff) |
hidraw: open unbuffered
Signed-off-by: Filipe Laíns <lains@riseup.net>
Diffstat (limited to 'ioctl/hidraw.py')
-rw-r--r-- | ioctl/hidraw.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ioctl/hidraw.py b/ioctl/hidraw.py index a083683..e41c714 100644 --- a/ioctl/hidraw.py +++ b/ioctl/hidraw.py @@ -5,7 +5,7 @@ import ctypes import fcntl import os -from typing import BinaryIO, List, Tuple +from typing import List, Tuple import ioctl @@ -50,7 +50,7 @@ class Hidraw(object): def __init__(self, path: str, read_length: int = 1024) -> None: self._path = path - self._fd = open(path, 'rb+') + self._fd = os.open(path, os.O_RDWR) self.read_length = read_length fcntl.fcntl(self._fd, fcntl.F_SETFL, os.O_NONBLOCK) @@ -65,7 +65,7 @@ class Hidraw(object): return self._path @property - def fd(self) -> BinaryIO: + def fd(self) -> int: ''' Node file descriptor ''' |