guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 33/55: Do not warn the user when 'madvise' returns ENOSY


From: Andy Wingo
Subject: [Guile-commits] 33/55: Do not warn the user when 'madvise' returns ENOSYS.
Date: Thu, 23 May 2019 11:52:41 -0400 (EDT)

wingo pushed a commit to branch master
in repository guile.

commit abeeec74b248880c337a3ae71e5fed2eabd77121
Author: Ludovic Courtès <address@hidden>
Date:   Sat Dec 15 18:04:27 2018 +0100

    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 e9e6ad0..82cdae9 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");
     }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]