~ubuntu-branches/ubuntu/maverick/devicekit-power/maverick

« back to all changes in this revision

Viewing changes to src/sysfs-utils.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Biebl
  • Date: 2009-06-03 13:47:15 UTC
  • mfrom: (1.2.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090603134715-2jrfcf9jtoqs3ohd
Tags: 008-1
* New upstream release.
* debian/copyright
  - Add Name, Maintainer and Source field as recommended by DEP-5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
#include <grp.h>
39
39
#include <linux/fs.h>
40
40
#include <sys/ioctl.h>
 
41
#include <glib.h>
41
42
 
42
43
#include "sysfs-utils.h"
43
44
 
141
142
        result = 0;
142
143
        filename = g_build_filename (dir, attribute, NULL);
143
144
        if (g_file_get_contents (filename, &contents, NULL, NULL)) {
144
 
                if (strcmp (contents, "1"))
 
145
                g_strdelimit (contents, "\n", '\0');
 
146
                if (g_strcmp0 (contents, "1") == 0)
145
147
                        result = TRUE;
146
148
                g_free (contents);
147
149
        }