From 40a64bcfe9d76a519eefc4df4e5491f5767bda14 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 16 Aug 2017 12:44:05 -0400 Subject: [PATCH] lib/deploy: Ignore errors from FITHAW MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the production case since we used `daemon()` our stderr is `/dev/null`¹ there's not much use in logging errors from `FITHAW` or `exit(1)`, and doing so breaks the test suite which checks the return from `waitpid()`. There's nothing we can really do if `FITHAW` fails, and in most of those cases `EINVAL`, `EOPNOTSUPP`, we *shouldn't* do anything anyways. ¹ Though perhaps we should set up the systemd journal, but let's not go there right now. Closes: #1084 Approved by: jlebon --- src/libostree/ostree-sysroot-deploy.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/libostree/ostree-sysroot-deploy.c b/src/libostree/ostree-sysroot-deploy.c index cb84a87f..60fbc1d3 100644 --- a/src/libostree/ostree-sysroot-deploy.c +++ b/src/libostree/ostree-sysroot-deploy.c @@ -1056,13 +1056,14 @@ fsfreeze_thaw_cycle (OstreeSysroot *self, /* Do a thaw if we hit an error, or if the poll timed out */ if (r <= 0) { - if (TEMP_FAILURE_RETRY (ioctl (rootfs_dfd, FITHAW, 0)) != 0) - { - if (errno == EPERM) - ; /* Ignore this for the test suite */ - else - err (1, "FITHAW"); - } + /* Ignore errors: + * EINVAL: Not frozen + * EPERM: For running the test suite as non-root + * EOPNOTSUPP: If the filesystem doesn't support it + */ + int saved_errno = errno; + (void) TEMP_FAILURE_RETRY (ioctl (rootfs_dfd, FITHAW, 0)); + errno = saved_errno; /* But if we got an error from poll, let's log it */ if (r < 0) err (1, "poll");