Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ptrace/binding/func.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
HAS_CPTRACE = True
except ImportError:
HAS_CPTRACE = False
from ctypes import c_long, c_ulong
from ctypes import c_ulong
from ptrace.ctypes_libc import libc

# Load ptrace() function from the system C library
Expand All @@ -155,8 +155,8 @@ def ptrace(command, pid=0, arg1=0, arg2=0, check_errno=False):
raise PtraceError(message, errno=errno, pid=pid)
else:
result = _ptrace(command, pid, arg1, arg2)
result_signed = c_long(result).value
if result_signed == -1:
result_unsigned = c_ulong(result).value
if result_unsigned == c_ulong(-1).value:
errno = get_errno()
# peek operations may returns -1 with errno=0:
# it's not an error. For other operations, -1
Expand Down