[dm-devel] [PATCH 21/78] Remove trailing linefeed from sysfs attributes

Hannes Reinecke hare at suse.de
Mon Mar 16 12:36:08 UTC 2015


When reading from sysfs attributes might have a trailing linefeed,
which will then show up in the log messages as an additional
linefeed.

Signed-off-by: Hannes Reinecke <hare at suse.de>
---
 libmultipath/sysfs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libmultipath/sysfs.c b/libmultipath/sysfs.c
index 0e05316..102135a 100644
--- a/libmultipath/sysfs.c
+++ b/libmultipath/sysfs.c
@@ -93,6 +93,8 @@ ssize_t sysfs_attr_get_value(struct udev_device *dev, const char *attr_name,
 	}
 
 	close(fd);
+	if (size > 0)
+		size = strchop(value);
 	return size;
 }
 
-- 
1.8.4.5




More information about the dm-devel mailing list