2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-09-05 08:45:49 +00:00

util: Print message when read size is bad

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
This commit is contained in:
Pavel Emelyanov
2012-01-18 17:46:22 +04:00
committed by Cyrill Gorcunov
parent 379dde63f5
commit 8836f20c64

View File

@@ -134,8 +134,10 @@ extern void printk(const char *format, ...);
#define read_safe_eof(fd, ptr, size, err) \
({ \
size_t rc__ = read(fd, ptr, (size)); \
if (rc__ && rc__ != (size)) \
if (rc__ && rc__ != (size)) { \
pr_err("img corruption %d/%d\n", rc__, (size));\
goto err; \
} \
rc__; \
})