From abeeec74b248880c337a3ae71e5fed2eabd77121 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sat, 15 Dec 2018 18:04:27 +0100 Subject: [PATCH] Do not warn the user when 'madvise' returns ENOSYS. * libguile/vm.c (return_unused_stack_to_os): Avoid 'perror' calls when 'madvise' returns ENOSYS. --- libguile/vm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libguile/vm.c b/libguile/vm.c index e9e6ad0c4..82cdae91a 100644 --- a/libguile/vm.c +++ b/libguile/vm.c @@ -660,7 +660,10 @@ return_unused_stack_to_os (struct scm_vm *vp) ret = madvise ((void *) lo, hi - lo, MADV_DONTNEED); while (ret && errno == EAGAIN); - if (ret) + /* If the OS doesn't implement 'madvise' (as is currently the case + for GNU/Hurd), don't warn the user since there's nothing they + can do about it. */ + if (ret && errno != ENOSYS) perror ("madvise failed"); }