[PATCH 20/41] libmultipath: rename __sysfs_attr_get_value()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Martin Wilck <mwilck@xxxxxxxx>
---
 libmultipath/sysfs.c |  6 +++---
 tests/sysfs.c        | 20 ++++++++++----------
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/libmultipath/sysfs.c b/libmultipath/sysfs.c
index afe9de9..b2c1ce0 100644
--- a/libmultipath/sysfs.c
+++ b/libmultipath/sysfs.c
@@ -45,7 +45,7 @@
  * as libudev lacks the capability to update an attribute value.
  * So for modified attributes we need to implement our own function.
  */
-static ssize_t __sysfs_attr_get_value(struct udev_device *dev, const char *attr_name,
+static ssize_t sysfs_attr_get_value__(struct udev_device *dev, const char *attr_name,
 				      char *value, size_t value_len, bool binary)
 {
 	const char *syspath;
@@ -100,13 +100,13 @@ static ssize_t __sysfs_attr_get_value(struct udev_device *dev, const char *attr_
 ssize_t sysfs_attr_get_value(struct udev_device *dev, const char *attr_name,
 			     char *value, size_t value_len)
 {
-	return __sysfs_attr_get_value(dev, attr_name, value, value_len, false);
+	return sysfs_attr_get_value__(dev, attr_name, value, value_len, false);
 }
 
 ssize_t sysfs_bin_attr_get_value(struct udev_device *dev, const char *attr_name,
 				 unsigned char *value, size_t value_len)
 {
-	return __sysfs_attr_get_value(dev, attr_name, (char *)value,
+	return sysfs_attr_get_value__(dev, attr_name, (char *)value,
 				      value_len, true);
 }
 
diff --git a/tests/sysfs.c b/tests/sysfs.c
index c623d1b..6dfa9f3 100644
--- a/tests/sysfs.c
+++ b/tests/sysfs.c
@@ -90,7 +90,7 @@ static int teardown(void **state)
 
 static void expect_sagv_invalid(void)
 {
-	expect_condlog(1, "__sysfs_attr_get_value: invalid parameters");
+	expect_condlog(1, "sysfs_attr_get_value__: invalid parameters");
 }
 
 static void test_sagv_invalid(void **state)
@@ -132,12 +132,12 @@ static void test_sagv_invalid(void **state)
 static void test_sagv_bad_udev(void **state)
 {
 	will_return(__wrap_udev_device_get_syspath, NULL);
-	expect_condlog(3, "__sysfs_attr_get_value: invalid udevice");
+	expect_condlog(3, "sysfs_attr_get_value__: invalid udevice");
 	assert_int_equal(sysfs_attr_get_value((void *)state, (void *)state,
 					      (void *)state, 1), -EINVAL);
 
 	will_return(__wrap_udev_device_get_syspath, NULL);
-	expect_condlog(3, "__sysfs_attr_get_value: invalid udevice");
+	expect_condlog(3, "sysfs_attr_get_value__: invalid udevice");
 	assert_int_equal(sysfs_bin_attr_get_value((void *)state, (void *)state,
 						  (void *)state, 1), -EINVAL);
 }
@@ -151,11 +151,11 @@ static void test_sagv_bad_snprintf(void **state)
 	longstr[sizeof(longstr) - 1] = '\0';
 
 	will_return(__wrap_udev_device_get_syspath, "/foo");
-	expect_condlog(3, "__sysfs_attr_get_value: devpath overflow");
+	expect_condlog(3, "sysfs_attr_get_value__: devpath overflow");
 	assert_int_equal(sysfs_attr_get_value((void *)state, longstr,
 					      buf, sizeof(buf)), -EOVERFLOW);
 	will_return(__wrap_udev_device_get_syspath, "/foo");
-	expect_condlog(3, "__sysfs_attr_get_value: devpath overflow");
+	expect_condlog(3, "sysfs_attr_get_value__: devpath overflow");
 	assert_int_equal(sysfs_bin_attr_get_value((void *)state, longstr,
 						  (unsigned char *)buf, sizeof(buf)),
 			 -EOVERFLOW);
@@ -171,7 +171,7 @@ static void test_sagv_open_fail(void **state)
 	expect_value(WRAP_OPEN, flags, O_RDONLY);
 	errno = ENOENT;
 	wrap_will_return(WRAP_OPEN, -1);
-	expect_condlog(3, "__sysfs_attr_get_value: attribute '/foo/bar' cannot be opened");
+	expect_condlog(3, "sysfs_attr_get_value__: attribute '/foo/bar' cannot be opened");
 	assert_int_equal(sysfs_attr_get_value((void *)state, "bar",
 					      buf, sizeof(buf)), -ENOENT);
 }
@@ -190,7 +190,7 @@ static void test_sagv_read_fail(void **state)
 	errno = EISDIR;
 	will_return(__wrap_read, -1);
 	will_return(__wrap_read, NULL);
-	expect_condlog(3, "__sysfs_attr_get_value: read from /foo/bar failed:");
+	expect_condlog(3, "sysfs_attr_get_value__: read from /foo/bar failed:");
 	will_return(__wrap_close, 0);
 	assert_int_equal(sysfs_attr_get_value((void *)state, "bar",
 					      buf, sizeof(buf)), -EISDIR);
@@ -205,7 +205,7 @@ static void test_sagv_read_fail(void **state)
 	errno = EPERM;
 	will_return(__wrap_read, -1);
 	will_return(__wrap_read, NULL);
-	expect_condlog(3, "__sysfs_attr_get_value: read from /foo/baz failed:");
+	expect_condlog(3, "sysfs_attr_get_value__: read from /foo/baz failed:");
 	will_return(__wrap_close, 0);
 	assert_int_equal(sysfs_bin_attr_get_value((void *)state, "baz",
 						  (unsigned char *)buf, sizeof(buf)),
@@ -235,7 +235,7 @@ static void _test_sagv_read(void **state, unsigned int bufsz)
 	if (bufsz <= sizeof(input) - 1) {
 		n = bufsz;
 		trunc = 1;
-		expect_condlog(3, "__sysfs_attr_get_value: overflow reading from /foo/bar");
+		expect_condlog(3, "sysfs_attr_get_value__: overflow reading from /foo/bar");
 	} else {
 		n = sizeof(input) - 1;
 		trunc = 0;
@@ -311,7 +311,7 @@ static void _test_sagv_read_zeroes(void **state, unsigned int bufsz)
 
 	if (bufsz <= sizeof(input) - 1) {
 		n = bufsz;
-		expect_condlog(3, "__sysfs_attr_get_value: overflow reading from /foo/bar");
+		expect_condlog(3, "sysfs_attr_get_value__: overflow reading from /foo/bar");
 	} else
 		n = 0;
 
-- 
2.46.0





[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux