From c33729ad2c9e31dea3f256af2841efead91e7628 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Thu, 17 Oct 2013 22:27:36 +0200 Subject: linux: Use boolean values in sysfs_get_bool, not int --- src/linux/sysfs-utils.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/linux/sysfs-utils.c b/src/linux/sysfs-utils.c index 748d04c..e32715c 100644 --- a/src/linux/sysfs-utils.c +++ b/src/linux/sysfs-utils.c @@ -99,16 +99,15 @@ sysfs_get_int (const char *dir, const char *attribute) gboolean sysfs_get_bool (const char *dir, const char *attribute) { - gboolean result = FALSE; + gboolean result; char *contents; char *filename; - result = 0; + result = FALSE; filename = g_build_filename (dir, attribute, NULL); if (g_file_get_contents (filename, &contents, NULL, NULL)) { g_strdelimit (contents, "\n", '\0'); - if (g_strcmp0 (contents, "1") == 0) - result = TRUE; + result = (g_strcmp0 (contents, "1") == 0); g_free (contents); } g_free (filename); -- cgit v1.2.1