Skip to content

Commit

Permalink
CA-388318: usb_reset.py: fixed byte issue
Browse files Browse the repository at this point in the history
CP-47043: Ported usb_reset.py to python3,shebang changed to python3 ,and made necessary changes to get result as list,function name load_device_ids,fixed unbufferered I/O value error,fixed bytes issue related to CA-388318

Signed-off-by: Ashwinh <[email protected]>
  • Loading branch information
ashwin9390 authored Jan 30, 2024
1 parent e196d15 commit dca5c64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/usb_reset.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def setup_cgroup(domid, pid): # type:(str, str) -> None

def mount(source, target, fs, flags=0):
if ctypes.CDLL(ctypes.util.find_library("c"), use_errno=True
).mount(source, target, fs, flags, None) < 0:
).mount(source.encode(), target.encode(), fs.encode(), flags, None) < 0:
log.error("Failed to mount {} ({}) to {} with flags {}: {}".
format(source, fs, target, flags,
os.strerror(ctypes.get_errno())))
Expand All @@ -271,7 +271,7 @@ def mount(source, target, fs, flags=0):

def umount(target):
if ctypes.CDLL(ctypes.util.find_library("c"), use_errno=True
).umount(target) < 0:
).umount(target.encode()) < 0:
# log and continue
log.error("Failed to umount {}: {}".
format(target, os.strerror(ctypes.get_errno())))
Expand Down

0 comments on commit dca5c64

Please sign in to comment.