Revision b459a848 lib/utils/mlock.py
b/lib/utils/mlock.py | ||
---|---|---|
28 | 28 |
from ganeti import errors |
29 | 29 |
|
30 | 30 |
try: |
31 |
# pylint: disable-msg=F0401
|
|
31 |
# pylint: disable=F0401 |
|
32 | 32 |
import ctypes |
33 | 33 |
except ImportError: |
34 | 34 |
ctypes = None |
... | ... | |
65 | 65 |
# By declaring this variable as a pointer to an integer we can then access |
66 | 66 |
# its value correctly, should the mlockall call fail, in order to see what |
67 | 67 |
# the actual error code was. |
68 |
# pylint: disable-msg=W0212
|
|
68 |
# pylint: disable=W0212 |
|
69 | 69 |
libc.__errno_location.restype = _ctypes.POINTER(_ctypes.c_int) |
70 | 70 |
|
71 | 71 |
if libc.mlockall(_MCL_CURRENT | _MCL_FUTURE): |
72 |
# pylint: disable-msg=W0212
|
|
72 |
# pylint: disable=W0212 |
|
73 | 73 |
logging.error("Cannot set memory lock: %s", |
74 | 74 |
os.strerror(libc.__errno_location().contents.value)) |
75 | 75 |
return |
Also available in: Unified diff