From: Hannes Reinecke Date: Fri, 11 Apr 2014 06:12:33 +0000 (+0200) Subject: Remove trailing linefeed from sysfs attributes X-Git-Tag: 0.6.0~93 X-Git-Url: https://git.opensvc.com/gitweb.cgi?p=multipath-tools%2F.git;a=commitdiff_plain;h=7a4b3f98b37652c094e5ebb5095340cfff1d6678;ds=sidebyside 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 --- 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; }