lib/deploy: Ignore errors from FITHAW

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
This commit is contained in:
Colin Walters 2017-08-16 12:44:05 -04:00 committed by Atomic Bot
parent ba28684ac2
commit 40a64bcfe9
1 changed files with 8 additions and 7 deletions

View File

@ -1056,13 +1056,14 @@ fsfreeze_thaw_cycle (OstreeSysroot *self,
/* Do a thaw if we hit an error, or if the poll timed out */ /* Do a thaw if we hit an error, or if the poll timed out */
if (r <= 0) if (r <= 0)
{ {
if (TEMP_FAILURE_RETRY (ioctl (rootfs_dfd, FITHAW, 0)) != 0) /* Ignore errors:
{ * EINVAL: Not frozen
if (errno == EPERM) * EPERM: For running the test suite as non-root
; /* Ignore this for the test suite */ * EOPNOTSUPP: If the filesystem doesn't support it
else */
err (1, "FITHAW"); 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 */ /* But if we got an error from poll, let's log it */
if (r < 0) if (r < 0)
err (1, "poll"); err (1, "poll");