[lvm-devel] master - dev: also check for blank sysfs value containing only '\n'

Peter Rajnoha prajnoha at fedoraproject.org
Tue Mar 22 08:33:53 UTC 2016


Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2a47f0957fb95136985c97d0b7b4580044e3f68d
Commit:        2a47f0957fb95136985c97d0b7b4580044e3f68d
Parent:        e69e81388dd84598a37b8b77c17c393bf570cf75
Author:        Peter Rajnoha <prajnoha at redhat.com>
AuthorDate:    Tue Mar 22 09:29:24 2016 +0100
Committer:     Peter Rajnoha <prajnoha at redhat.com>
CommitterDate: Tue Mar 22 09:29:24 2016 +0100

dev: also check for blank sysfs value containing only '\n'

---
 lib/device/dev-cache.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c
index d912dea..bcee783 100644
--- a/lib/device/dev-cache.c
+++ b/lib/device/dev-cache.c
@@ -379,7 +379,7 @@ static int _get_sysfs_value(const char *path, char *buf, size_t buf_size)
 		return 0;
 	}
 
-	if (!(len = strlen(buf))) {
+	if (!(len = strlen(buf)) || (len == 1 && buf[0] == '\n')) {
 		log_error("_get_sysfs_value: %s: no value", path);
 		return 0;
 	}




More information about the lvm-devel mailing list