From 2dba165c63cc1b687bb9f035a8f01f40595a708a Mon Sep 17 00:00:00 2001 From: Lukas Nykryn Date: Fri, 13 Sep 2013 14:12:55 +0200 Subject: random-seed: we should return errno of failed loop_write --- src/random-seed/random-seed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/random-seed') diff --git a/src/random-seed/random-seed.c b/src/random-seed/random-seed.c index 4776c071ca..afbd5002dd 100644 --- a/src/random-seed/random-seed.c +++ b/src/random-seed/random-seed.c @@ -157,7 +157,7 @@ int main(int argc, char *argv[]) { r = loop_write(seed_fd, buf, (size_t) k, false); if (r <= 0) { log_error("Failed to write new random seed file: %s", r < 0 ? strerror(-r) : "short write"); - r = k == 0 ? -EIO : (int) k; + r = r == 0 ? -EIO : r; } } -- cgit v1.2.3-54-g00ecf