Introduce loop_read_exact helper
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 10 Mar 2015 01:23:53 +0000 (21:23 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 10 Mar 2015 02:10:54 +0000 (22:10 -0400)
commita6dcc7e5924f9c27d3e9c6560a448b02ec28b65f
tree694aa3c7b5b2f4e61fb8c25d5bd8d1f023cf511e
parentad7bcf526d5ec54838bc9411a0e09a293845a015
Introduce loop_read_exact helper

Usually when using loop_read(), we want to read the full buffer.
Add a helper that mirrors loop_write(), and returns 0 when full buffer
was read, and an error otherwise.

Use -ENODATA for the short read, to distinguish it from a read error.
src/core/automount.c
src/core/machine-id-setup.c
src/journal/compress.c
src/journal/journalctl.c
src/libsystemd/sd-id128/sd-id128.c
src/shared/logs-show.c
src/shared/util.c
src/shared/util.h