mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 14:25:49 +00:00
criu-ns: Convert c_char_p strings to bytes object
class ctypes.c_char_p Represents the C char * datatype when it points to a zero- terminated string. For a general character pointer that may also point to binary data, POINTER(c_char) must be used. The constructor accepts an integer address, or a bytes object. https://docs.python.org/3/library/ctypes.html#ctypes.c_char_p Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
This commit is contained in:
committed by
Andrei Vagin
parent
d16033658f
commit
b2232f7f7a
@@ -74,11 +74,11 @@ def wrap_restore():
|
|||||||
os.close(r_pipe)
|
os.close(r_pipe)
|
||||||
|
|
||||||
# Mount new /proc
|
# Mount new /proc
|
||||||
if _mount(None, "/", None, MS_SLAVE|MS_REC, None) != 0:
|
if _mount(None, b"/", None, MS_SLAVE|MS_REC, None) != 0:
|
||||||
_errno = ctypes.get_errno()
|
_errno = ctypes.get_errno()
|
||||||
raise OSError(_errno, errno.errorcode[_errno])
|
raise OSError(_errno, errno.errorcode[_errno])
|
||||||
|
|
||||||
if _mount('proc', '/proc', 'proc', 0, None) != 0:
|
if _mount(b'proc', b'/proc', b'proc', 0, None) != 0:
|
||||||
_errno = ctypes.get_errno()
|
_errno = ctypes.get_errno()
|
||||||
raise OSError(_errno, errno.errorcode[_errno])
|
raise OSError(_errno, errno.errorcode[_errno])
|
||||||
|
|
||||||
@@ -98,7 +98,7 @@ def wrap_restore():
|
|||||||
status = -251
|
status = -251
|
||||||
break
|
break
|
||||||
|
|
||||||
os.write(w_pipe, "%d" % status)
|
os.write(w_pipe, b"%d" % status)
|
||||||
os.close(w_pipe)
|
os.close(w_pipe)
|
||||||
|
|
||||||
if status != 0:
|
if status != 0:
|
||||||
|
Reference in New Issue
Block a user