Skip to content

Commit

Permalink
Do not call ERROR macro in check_err in bus.c: every error is now pro…
Browse files Browse the repository at this point in the history
…perly propagated and (hopefully) managed by each module.
  • Loading branch information
FedeDP committed Jul 23, 2018
1 parent 243b31e commit 225a1bf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
6 changes: 6 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
## 2.3
- [x] Fix bus check_err(): avoid ERROR macro call. It is useless as any error is now caught in code.

## 2.4
- [ ] Switch to [libmodule](https://github.com/FedeDP/libmodule) to manage modules

## 2.X
Expand All @@ -8,3 +11,6 @@

## Later/ideas
- [ ] add a kde/gnome module to set a dark theme on sunrise/sunset (gnome: http://www.fandigital.com/2012/06/change-theme-command-line-gnome.html)

- [ ] KDE: https://userbase.kde.org/KDE_Connect/Tutorials/Useful_commands#Change_look_and_feel
- [ ] Add a clight command for kdeconnect to run "clight -c"? (is that even possible -> yes, see .config/kdeconnect/X/kdeconnect_runcommand/config
13 changes: 1 addition & 12 deletions src/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,18 +318,7 @@ static void free_bus_structs(sd_bus_error *err, sd_bus_message *m, sd_bus_messag
*/
static int check_err(int r, sd_bus_error *err) {
if (r < 0) {
/* Only leave for EHOSTUNREACH if it comes from clightd */
if (r == -EHOSTUNREACH && err && err->message) {
if (strstr(err->message, "/org/clightd/backlight")) {
ERROR("%s\n", err->message);
}
}
/* Don't leave for ebusy/eperm/EHOSTUNREACH errors. eperm may mean that a not-active session called a method on clightd */
if (r == -EBUSY || r == -EPERM || r == -EHOSTUNREACH) {
WARN("%s\n", err && err->message ? err->message : strerror(-r));
} else {
ERROR("%s\n", err && err->message ? err->message : strerror(-r));
}
WARN("%s\n", err && err->message ? err->message : strerror(-r));
}
/* -1 on error, 0 ok */
return -(r < 0);
Expand Down

0 comments on commit 225a1bf

Please sign in to comment.