diff options
-rw-r--r-- | src/location-corelocation.m | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/location-corelocation.m b/src/location-corelocation.m index 1a04d54..10d7acd 100644 --- a/src/location-corelocation.m +++ b/src/location-corelocation.m @@ -89,6 +89,17 @@ typedef struct { pipeutils_signal(self.state->pipe_fd_write); } +- (void)markUnavailable +{ + [self.state->lock lock]; + + self.state->available = 0; + + [self.state->lock unlock]; + + pipeutils_signal(self.state->pipe_fd_write); +} + - (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations { @@ -110,7 +121,11 @@ typedef struct { { fprintf(stderr, _("Error obtaining location from CoreLocation: %s\n"), [[error localizedDescription] UTF8String]); - [self markError]; + if ([error code] == kCLErrorDenied) { + [self markError]; + } else { + [self markUnavailable]; + } } - (void)locationManager:(CLLocationManager *)manager |