File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -217,19 +217,16 @@ is_on_ac_power ()
217
217
g_autoptr (GDir ) dir = g_dir_open (DIRNAME , 0 , & err );
218
218
219
219
if (err ) {
220
- g_warning ("Cannot read battery status: %s" , err -> message );
220
+ g_warning ("Cannot read battery/AC status: %s" , err -> message );
221
221
return FALSE;
222
222
}
223
223
224
224
while ((basename = g_dir_read_name (dir ))) {
225
225
g_autofree char * filename = g_build_filename (DIRNAME , basename , "online" , NULL );
226
226
g_autofree char * contents = NULL ;
227
227
228
- g_debug ("Reading '%s'" , filename );
229
- if (! g_file_get_contents (filename , & contents , NULL , & err )) {
230
- g_debug ("Cannot read '%s': %s" , filename , err -> message );
228
+ if (! g_file_get_contents (filename , & contents , NULL , NULL ))
231
229
continue ;
232
- }
233
230
234
231
if (g_strcmp0 (g_strstrip (contents ), "1" ) == 0 )
235
232
return TRUE;
You can’t perform that action at this time.
0 commit comments