Skip to content
This repository has been archived by the owner on May 20, 2024. It is now read-only.

Commit

Permalink
libgpiod: use gpiod_line_event_get_fd() in gpiod_line_event_read()
Browse files Browse the repository at this point in the history
  • Loading branch information
hhk7734 committed Apr 13, 2021
1 parent a1cdc8a commit 83e33d2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions py_src/gpiod/libgpiod/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -991,11 +991,11 @@ def gpiod_line_event_read(line: gpiod_line, event: gpiod_line_event) -> int:
@note This function will block if no event was queued for this line.
"""
if line.state != _LINE_REQUESTED_EVENTS:
set_errno(EPERM)
fd = gpiod_line_event_get_fd(line)
if fd < 0:
return -1

return gpiod_line_event_read_fd(line.fd_handle.fd, event)
return gpiod_line_event_read_fd(fd, event)


def gpiod_line_event_get_fd(line: gpiod_line) -> int:
Expand Down

0 comments on commit 83e33d2

Please sign in to comment.