mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-17 16:47:50 +00:00
This commit removes the checks for the Python 2 binary in the makefile and makes sure that ZDTM tests always use python3. Since support for Python 2 has been dropped, these checks are no longer needed. Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
19 lines
418 B
Python
Executable file
19 lines
418 B
Python
Executable file
#!/usr/bin/env python3
|
|
import fcntl
|
|
import tempfile
|
|
import struct
|
|
import errno
|
|
|
|
F_OFD_SETLK = 37
|
|
|
|
try:
|
|
with tempfile.TemporaryFile() as fd:
|
|
flock = struct.pack('hhllhh', fcntl.F_RDLCK, 0, 0, 0, 0, 0)
|
|
fcntl.fcntl(fd.fileno(), F_OFD_SETLK, flock)
|
|
except IOError as e:
|
|
if e.errno == errno.EINVAL:
|
|
print("I/O error({0}): {1}".format(e.errno, e.strerror))
|
|
print("OFD locks are not supported.")
|
|
exit(1)
|
|
|
|
exit(0)
|