From 05e29c343ab5af345960127ba0bed7d730eee6c8 Mon Sep 17 00:00:00 2001 From: Dan Streetman Date: Tue, 8 Sep 2020 13:10:37 -0400 Subject: don't fail completely if we can't set write wakeup watermark We won't have access to change the watermark if we're running in an unprivileged container, so if the error is EACCES just warn and continue --- src/haveged.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/haveged.c b/src/haveged.c index 014b4ba..733d0da 100644 --- a/src/haveged.c +++ b/src/haveged.c @@ -694,6 +694,9 @@ static void set_watermark( /* RETURN: nothing */ fprintf(wm_fh, "%d\n", level); fclose(wm_fh); } + else if (errno == EACCES) + fprintf(stderr, "No access to %s, can't set watermark (maybe running in a container?)\n", + params->watermark); else error_exit("Fail:set_watermark()!"); } #endif -- cgit v1.2.3