From 30a653105ca25665dcdc3c5077a374ae0b05211b Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Tue, 25 May 2010 08:40:36 +0000 Subject: [PATCH] Fix copy&paste detection of kernel release version. Add log_error to avoid return_0 without log_error. --- libdm/libdm-deptree.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c index b75e6afae..e1813b40f 100644 --- a/libdm/libdm-deptree.c +++ b/libdm/libdm-deptree.c @@ -1542,8 +1542,10 @@ static int _mirror_emit_segment_line(struct dm_task *dmt, uint32_t major, const char *logtype; unsigned kmaj, kmin, krel; - if (!uname(&uts) || sscanf(uts.release, "%u.%u.%u", &kmaj, &kmin, &krel) != 3) - return_0; + if (uname(&uts) == -1 || sscanf(uts.release, "%u.%u.%u", &kmaj, &kmin, &krel) != 3) { + log_error("Cannot read kernel release version"); + return 0; + } if ((seg->flags & DM_BLOCK_ON_ERROR)) { /* -- 2.43.5