From ad2c296b46361df16b6362b8af8a5748e051c024 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Tue, 29 Mar 2022 21:55:35 +0200 Subject: [PATCH] iio: Fix sysfs attribute verification failing sysfs usually appends newlines at the end of attributes to make them easier to consume, but the test suite can't test for that. ** (iio-sensor-proxy:4882): WARNING **: 14:14:46.792: Possible failure in string write of 'accel_3d-dev0 ' Should be 'accel_3d-dev0' written to /sys/devices/platform/AMDI0010:02/i2c-2/i2c-BMA250E:00/0018:6243:0001.0002/HID-SENSOR-200073.2.auto/iio:device0/trigger/current_trigger Closes: #347 Fixes: ac053f8a120866bea53e8dd8c459a57a5053a5af --- src/iio-buffer-utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/iio-buffer-utils.c b/src/iio-buffer-utils.c index 2e6fb97..f41708e 100644 --- a/src/iio-buffer-utils.c +++ b/src/iio-buffer-utils.c @@ -416,7 +416,7 @@ _write_sysfs_string (const char *filename, return 0; g_clear_pointer (&sysfsfp, fclose); if (!g_file_get_contents (temp, &contents, NULL, NULL) || - g_strcmp0 (contents, val) != 0) { + g_strcmp0 (g_strchomp (contents), val) != 0) { g_warning ("Possible failure in string write of '%s' Should be '%s' written to %s\n", contents ?: "(null)", val, temp); return -1;