MCPcopy Create free account
hub / github.com/FedeDP/Clight / geoclue_init

Function geoclue_init

src/modules/location.c:164–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162}
163
164static 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
179static int parse_bus_reply(sd_bus_message *reply, const char *member, void *userdata) {
180 int r = -EINVAL;

Callers 1

receiveFunction · 0.85

Calls 2

geoclue_pingFunction · 0.85
geoclue_get_clientFunction · 0.85

Tested by

no test coverage detected