From 7a4b3f98b37652c094e5ebb5095340cfff1d6678 Mon Sep 17 00:00:00 2001 From: Hannes Reinecke Date: Fri, 11 Apr 2014 08:12:33 +0200 Subject: [PATCH] Remove trailing linefeed from sysfs attributes 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 --- libmultipath/sysfs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libmultipath/sysfs.c b/libmultipath/sysfs.c index 0e05316d..102135aa 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; } -- 2.20.1