Remove trailing linefeed from sysfs attributes
authorHannes Reinecke <hare@suse.de>
Fri, 11 Apr 2014 06:12:33 +0000 (08:12 +0200)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Sun, 29 Mar 2015 15:50:43 +0000 (17:50 +0200)
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@suse.de>
libmultipath/sysfs.c

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