Set errno to 0 before the call to mlock in rstat_mlock() Signed-off-by: John Kacur <jkacur@xxxxxxxxxx> --- src/cyclictest/cyclictest.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c index 01ae72f8cdf1..c66755dd4d87 100644 --- a/src/cyclictest/cyclictest.c +++ b/src/cyclictest/cyclictest.c @@ -1868,9 +1868,8 @@ static int rstat_mlock(void *mptr) { int err; - err = mlock(mptr, _SC_PAGE_SIZE); - errno = 0; + err = mlock(mptr, _SC_PAGE_SIZE); if (err == -1) { fprintf(stderr, "ERROR, mlock %s\n", strerror(errno)); } -- 2.20.1