mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-05-09 07:08:07 +02:00
linux: Don't throw debug errors unless needed
It's really confusing seeing "not a switch [...]" when we actually managed to find a switch, so throw 2 errors in the debug when both checks fail, rather than as things are being tested.
This commit is contained in:
parent
47481f3a57
commit
522fb6fff2
1 changed files with 7 additions and 4 deletions
|
|
@ -182,13 +182,16 @@ up_input_coldplug (UpInput *input, GUdevDevice *d)
|
|||
/* is a switch */
|
||||
path = g_build_filename (native_path, "../capabilities/sw", NULL);
|
||||
if (!g_file_test (path, G_FILE_TEST_EXISTS)) {
|
||||
g_debug ("not a switch [%s]", path);
|
||||
g_free (path);
|
||||
path = g_build_filename (native_path, "capabilities/sw", NULL);
|
||||
if (!g_file_test (path, G_FILE_TEST_EXISTS)) {
|
||||
char *path2;
|
||||
path2 = g_build_filename (native_path, "capabilities/sw", NULL);
|
||||
if (!g_file_test (path2, G_FILE_TEST_EXISTS)) {
|
||||
g_debug ("not a switch [%s]", path);
|
||||
g_debug ("not a switch [%s]", path2);
|
||||
g_free (path2);
|
||||
goto out;
|
||||
}
|
||||
g_free (path);
|
||||
path = path2;
|
||||
}
|
||||
|
||||
/* get caps */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue