| 162 | } |
| 163 | |
| 164 | static int geoclue_init(void) { |
| 165 | // Check if geoclue is available, otherwise die |
| 166 | int r = geoclue_ping(); |
| 167 | if (r >= 0) { |
| 168 | // GetClient is called async, and will later start the client in its callback, see parse_bus_reply |
| 169 | r = geoclue_get_client(); |
| 170 | if (r < 0) { |
| 171 | WARN("Geoclue2 is present but failed to give us a client.\n"); |
| 172 | } |
| 173 | } else { |
| 174 | DEBUG("Geoclue2 is not present.\n"); |
| 175 | } |
| 176 | return -(r < 0); // - 1 on error |
| 177 | } |
| 178 | |
| 179 | static int parse_bus_reply(sd_bus_message *reply, const char *member, void *userdata) { |
| 180 | int r = -EINVAL; |
no test coverage detected